Created
February 25, 2016 21:31
-
-
Save sofroniewn/0eff893d327d32741d11 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
| var raspi = require('raspi-io') | |
| var five = require('johnny-five') | |
| var board = new five.Board({ | |
| io: new raspi() | |
| }) | |
| board.on('ready', function() { | |
| var led = new five.Led(0) | |
| var spdt = new five.Switch(2) | |
| spdt.on('close', function () { | |
| led.on() | |
| }) | |
| spdt.on('open', function () { | |
| led.off() | |
| }) | |
| }) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Latencies ranged from 5 ms to 20 ms