Created
July 25, 2015 19:48
-
-
Save ZachWatkins/65d14e0ebfe9e6916f73 to your computer and use it in GitHub Desktop.
Leap Motion Arduino Hand Position
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var leapjs = require('leapjs'), | |
five = require('johnny-five'), | |
board = new five.Board(), | |
myServo, | |
controller = new leapjs.Controller(); | |
controller.on('connect', function() { | |
console.log('Successfully connected.'); | |
}); | |
controller.on('frame', function() { | |
console.log('looping'); | |
if (frame.hands.length === 1){ | |
console.log(frame.hands[0].palmPosition[1]); | |
} | |
}); | |
controller.on('deviceStreaming', function() { | |
console.log("A Leap device has been connected."); | |
}); | |
controller.on('deviceStopped', function() { | |
console.log("A Leap device has been disconnected."); | |
}); | |
board.on("ready", function() { | |
console.log("board ready"); | |
controller.connect(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment