Skip to content

Instantly share code, notes, and snippets.

@ZachWatkins
Created July 25, 2015 19:48
Show Gist options
  • Save ZachWatkins/65d14e0ebfe9e6916f73 to your computer and use it in GitHub Desktop.
Save ZachWatkins/65d14e0ebfe9e6916f73 to your computer and use it in GitHub Desktop.
Leap Motion Arduino Hand Position
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