Getting leapmotion to talk to arduino.
Top 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.
- Run
npm install
- Enable websockets on Leapmotion:
- Run
node leap.js
- Sit-back and enjoy the raw JSON feed! Example frame in
leap.json
- Flash the Arduino with StandardFirmata:
- Run
node arduino.js
- Run
node leap-arduino.js
- Placing two hands above leap will switch built-in LED on pin 13 on, otherwise off.
- Wire up a servo to pin 9.
- Run
node servo.js
. - Tweak ranges in code if need (servo and leap).