Created
July 9, 2015 01:58
-
-
Save crowelch/916250c116d7d59fe7c9 to your computer and use it in GitHub Desktop.
Cylon vs. Johnny-Five Blink Sketch
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 Cylon = require('cylon'); | |
| // define the robot | |
| var robot = Cylon.robot({ | |
| // change the port to the correct one for your Arduino | |
| connections: { | |
| arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' } | |
| }, | |
| devices: { | |
| led: { driver: 'led', pin: 13 } | |
| }, | |
| work: function(my) { | |
| every((1).second(), my.led.toggle); | |
| } | |
| }); | |
| // connect to the Arduino and start working | |
| robot.start(); |
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 five = require("johnny-five"); | |
| var board = new five.Board(); | |
| board.on("ready", function() { | |
| // Create an Led on pin 13 | |
| var led = new five.Led(13); | |
| // Blink every half second | |
| led.blink(1000); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment