{"id":16241341,"url":"https://github.com/dtex/huskylens","last_synced_at":"2026-01-21T17:35:35.390Z","repository":{"id":42797011,"uuid":"254536355","full_name":"dtex/huskylens","owner":"dtex","description":"Johnny-Five plug in for the HuskyLens AI Vision Center","archived":false,"fork":false,"pushed_at":"2023-10-02T23:21:04.000Z","size":187,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T14:03:55.520Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dtex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-04-10T03:35:31.000Z","updated_at":"2023-05-26T09:27:05.000Z","dependencies_parsed_at":"2024-10-27T21:43:41.062Z","dependency_job_id":null,"html_url":"https://github.com/dtex/huskylens","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":"0.19999999999999996","last_synced_commit":"56e1de8e5e8f79c7591a366be6da4023edba8cf0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtex%2Fhuskylens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtex%2Fhuskylens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtex%2Fhuskylens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtex%2Fhuskylens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dtex","download_url":"https://codeload.github.com/dtex/huskylens/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247723638,"owners_count":20985396,"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-10-10T14:07:13.272Z","updated_at":"2026-01-21T17:35:35.359Z","avatar_url":"https://github.com/dtex.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HuskyLens\nA [Johnny-Five](http://johnny-five.io) plug-in for the HuskyLens AI Vision Sensor. Learn more about the HuskyLens at [DFRobot](https://www.dfrobot.com/index.php?route=page/HuskyLens).\n\nAI on robots doesn't get any easier than this.\n\n![HuskyLens](https://raw.githubusercontent.com/dtex/huskylens/master/static/image1.jpg)\n*Image courtesy DFRobot*\n\nTo purchase the HuskyLens, go to [dfrobot.com](https://www.dfrobot.com/index.php?route=page/huskylens)\n\n*This repo is not affiliated with DFRobot. Their HuskyLens stuff is [here](https://github.com/HuskyLens).*\n\n## Example\n````js\nconst five = require(\"johnny-five\");\nconst HuskyLens = require(\"../index.js\")(five);\n\nconst board = new five.Board();\n\nboard.on(\"ready\", () =\u003e {\n\n  const lens = new HuskyLens({\n    pins: { rx:11, tx:10 },\n    mode: \"OBJECT_RECOGNITION\"\n  });\n\n  lens.on(\"ready\", () =\u003e {\n    console.log(\"The HuskyLens is connected and ready\");\n  });\n\n  lens.on(\"block\", block =\u003e {\n    console.log(block);\n  });\n\n  lens.on(\"arrow\", arrow =\u003e {\n    console.log(arrow);\n  });\n\n});\n````\n\nSee the ```examples``` folder for more, uh, examples.\n\n## Instantiation\n\n````js\nconst lens = new HuskyLens(opts);\n````\nThe ```opts``` parameter can be an array of pins in ```[rx, tx]``` order or a complete options object. \n\nIf an object:\n\n```opts.pins``` - An array of pins in ```[rx, tx]``` order or a pins object ```{ rx: 11, tx: 10 }```.\n\n```opts.mode``` - A string selecting which mode to put the HuskyLens in at start (default: ```\"FACE_RECOGNITION\"```). Recognized values are:\n * \"FACE_RECOGNITION\"\n * \"OBJECT_TRACKING\"\n * \"OBJECT_RECOGNITION\"\n * \"LINE_TRACKING\"\n * \"COLOR_RECOGNITION\"\n * \"TAG_RECOGNITION\"\n * \"OBJECT_CLASSIFICATION\"\n\n```opts.baud``` - The speed of serial communications between your device and the HuskyLens (default: 9600)\n\n```opts.freq``` - The frequency of data updates requested from the HuskyLens (default: 10hz)\n\n## Methods\n\n````js\nlens.mode(\u003cstring\u003e mode);\n````\nChange modes at run time. ```mode``` can be any of the values described in the \"Instantiation\" section. If no value is passed for mode, this method will return the current mode as a string.\n\n````js\nlens.freq(\u003cnumber\u003e frequency);\n````\nSet the frequency (in hz) of data updates from the HuskyLens. If no value is passed for frequency, this method will return th current frequency.\n\n````js\nlens.stop();\n````\nStop requesting updates from the HuskyLens.\n\n````js\nlens.start();\n````\nResume requesting updates from the HuskyLens.\n\n## Events\n\nThe ```lens``` instance is an event emitter so you can simply set up listeners to take action when new information is reported.\n\n````js\n// When any block is received\nlens.on(\"block\", data =\u003e {\n  console.log(data);\n});\n\n// When block id:3 is received\nlens.on(\"block-3\", data =\u003e {\n  console.log(data);\n});\n\n// When an arrow is received\nlens.on(\"arrow\", data =\u003e {\n  console.log(data);\n});\n\n// When an arrow id:2 is received\nlens.on(\"arrow-2\", data =\u003e {\n  console.log(data);\n});\n````\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtex%2Fhuskylens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdtex%2Fhuskylens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtex%2Fhuskylens/lists"}