Last active
January 30, 2016 04:54
-
-
Save deadprogram/8d545447509b3799ffee to your computer and use it in GitHub Desktop.
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
| "use strict"; | |
| var Cylon = require("cylon"); | |
| Cylon.robot({ | |
| connections: { | |
| leap: { adaptor: "leapmotion" }, | |
| arduino: { adaptor: "firmata", port: "/dev/tty.usbmodem1411" } | |
| }, | |
| devices: { | |
| led: { driver: "led", pin: 13, connection: "arduino" }, | |
| leapmotion: {driver: "leapmotion", connection: "leap"} | |
| }, | |
| work: function(my) { | |
| my.leapmotion.on("frame", function(frame) { | |
| if (frame.hands.length > 0) { | |
| my.led.turnOn(); | |
| } else { | |
| my.led.turnOff(); | |
| } | |
| }); | |
| } | |
| }).start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment