{"id":21101628,"url":"https://github.com/decodedco/leap-arduino","last_synced_at":"2025-09-07T21:05:15.560Z","repository":{"id":20062352,"uuid":"23331023","full_name":"DecodedCo/leap-arduino","owner":"DecodedCo","description":"Getting leapmotion to talk to arduino","archived":false,"fork":false,"pushed_at":"2016-09-23T14:36:10.000Z","size":317,"stargazers_count":16,"open_issues_count":0,"forks_count":6,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-04T05:11:19.746Z","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":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DecodedCo.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}},"created_at":"2014-08-25T22:34:11.000Z","updated_at":"2022-06-09T02:12:58.000Z","dependencies_parsed_at":"2022-09-02T13:41:37.192Z","dependency_job_id":null,"html_url":"https://github.com/DecodedCo/leap-arduino","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DecodedCo/leap-arduino","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DecodedCo%2Fleap-arduino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DecodedCo%2Fleap-arduino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DecodedCo%2Fleap-arduino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DecodedCo%2Fleap-arduino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DecodedCo","download_url":"https://codeload.github.com/DecodedCo/leap-arduino/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DecodedCo%2Fleap-arduino/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274095419,"owners_count":25221433,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-19T23:47:40.159Z","updated_at":"2025-09-07T21:05:15.502Z","avatar_url":"https://github.com/DecodedCo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leapmotion + Arduino\n\nGetting leapmotion to talk to arduino.\n\nTop level: Leapmotion makes data available via websockets on ```ws://127.0.0.1:6437```. Node.js can parse this. There is also a Node.js library for talking to Arduino called Johnny-five. You need something called StandardFirmata which standardises commands sent between the Arduino and a host computer, which Johnny-five speaks.\n\n**Note: the `serialport` library only works with node 0.12.x**\n\n## 1. Setup\n\n1. Install [nodejs](http://www.nodejs.org/)\n1. Run ``npm install``\n\n## 2. Leapmotion + Node.js\n\n2. Enable websockets on Leapmotion:\n\t![Enable websockets on Leapmotion](docs/leap_enable_ws.png?raw=true \"Enable websockets on Leapmotion\")\n3. Run ``node leap.js``\n4. Sit-back and enjoy the raw JSON feed! Example frame in ``leap.json``\n\n## 3. Arduino + Node.js\n\n1. Flash the Arduino with [StandardFirmata](http://arduino.cc/en/reference/firmata):\n\t![Install StandardFirmata](docs/arduino_firmata.png?raw=true \"Install StandardFirmata\")\n2. Run ``node arduino.js``\n\n## 4. Arduino + Leapmotion via Node.js\n\n1. Run ``node leap-arduino.js`` (ref [@xavier_seignard](http://xseignard.github.io/2013/06/25/interfacing-leap-motion-with-arduino-thanks-to-nodejs/))\n2. Placing one or more hands above leap will switch built-in LED on pin 13 on, otherwise off.\n3. Run ``node leap-gestures.js``\n4. You should see console output for a Screen Tap, Key Tap, Circle and Swipe.\n\n## 5. Detecting valid ranges from your Leapmotion\n\n1. Run ``node leap-range.js``\n2. Move both hands around for a while in all directions\n3. Stop program when you stop seeing changes. The final values are the min and max ranges (in mm) of your current setup.\n\n## 6. Leapmotion + Servo (via Arduino and Node.js)\n\n1. Wire up a servo to pin 9.\n2. Run ```node servo.js```.\n3. Tweak ranges in code if need (servo and leap). Here is a demo video:\n\t[![Leap Servo demo](http://img.youtube.com/vi/DMbuZKZWZlk/0.jpg)](https://www.youtube.com/watch?v=DMbuZKZWZlk)\n\n## 7. Leapmotion + 6 Servos\n\nTested using 6 degrees of freedom robot arm from: http://www.lynxmotion.com/c-130-al5d.aspx\n\n1. Open ``six-servos.js`` and adjust parameters\n2. Run ``node six-servos.js``\n\n## Resources\n\n* [Johnny-five API](https://github.com/rwaldron/johnny-five/wiki)\n* [Leapmotion API](https://developer.leapmotion.com/documentation/cpp/api/Leap_Classes.html)\n* [Robotic hand demo](http://www.instructables.com/id/Robotic-Hand-controlled-by-Gesture-with-Arduino-Le/)\n* [Robotic lamp demo](http://xseignard.github.io/2013/06/25/interfacing-leap-motion-with-arduino-thanks-to-nodejs/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecodedco%2Fleap-arduino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecodedco%2Fleap-arduino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecodedco%2Fleap-arduino/lists"}