{"id":20319947,"url":"https://github.com/banjerr/busyornot","last_synced_at":"2025-07-13T13:34:09.250Z","repository":{"id":84220113,"uuid":"79737793","full_name":"Banjerr/busyOrNot","owner":"Banjerr","description":"Another Arduino exercise, re-factored with Node","archived":false,"fork":false,"pushed_at":"2017-01-23T00:10:27.000Z","size":30824,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-04T09:32:13.723Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Banjerr.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-22T18:53:39.000Z","updated_at":"2017-01-22T19:51:26.000Z","dependencies_parsed_at":"2023-05-24T00:45:22.504Z","dependency_job_id":null,"html_url":"https://github.com/Banjerr/busyOrNot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Banjerr/busyOrNot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Banjerr%2FbusyOrNot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Banjerr%2FbusyOrNot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Banjerr%2FbusyOrNot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Banjerr%2FbusyOrNot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Banjerr","download_url":"https://codeload.github.com/Banjerr/busyOrNot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Banjerr%2FbusyOrNot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265151393,"owners_count":23719120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T18:48:31.748Z","updated_at":"2025-07-13T13:34:09.227Z","avatar_url":"https://github.com/Banjerr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# busyOrNot?\n\nAnother Arduino exercise that I've re-factored to use Node js with the Johnny-Five library. Basically, the little dial (potentiometer) speaks to the servo to tell it what it's \"angle\" should be; the idea was to have the servo arm point to a specific \"state\", to let others know if the person was busy or not.\n\nI think I might use this as the basis for a \"bed time traffic light\" for my daughter; with the addition of some photo-resistors to check how much light is coming in.\n\n![pic!](https://github.com/Banjerr/busyOrNot/blob/master/busyOrNot.gif)\n\n## original C/C++ Arduino code\n\n```c\n/**\n * BUSY OR NOT?\n * by Benjamin Redden\n */\n\n#include \u003cServo.h\u003e\nServo myServo;\n\nint const potPin = A0;\nint potVal;\nint angle;\n\nvoid setup() {\n  myServo.attach(9);\n\n  Serial.begin(9600);\n}\n\nvoid loop() {\n  potVal = analogRead(potPin);\n  Serial.print(\"potVal: \");\n  Serial.print(potVal);\n\n  angle = map(potVal, 0, 1023, 0, 179);\n  Serial.print(\", angle: \");\n  Serial.print(angle);\n\n  myServo.write(angle);\n  delay(15);\n}\n```\n\n## refactored, Node JS (Johnny-Five) code\n\n```javascript\n'use strict'\n\n/**\n * BUSY OR NOT?\n * by Benjamin Redden\n */\n\nconst five = require('johnny-five'),\n  board = new five.Board();\n\nboard.on('ready', function() {\n  let myServo = new five.Servo(9),\n    potPin = new five.Sensor({\n      pin: \"A0\",\n      freq: 250\n    }),\n    potVal,\n    angle = five.Fn.map(potVal, 0, 1023, 0 ,179);\n\n  // get the current reading\n  potPin.on('data', function(){\n    potVal = this.value;\n\n    myServo.to(angle);\n  });\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanjerr%2Fbusyornot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbanjerr%2Fbusyornot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanjerr%2Fbusyornot/lists"}