Skip to content

Instantly share code, notes, and snippets.

@sofroniewn
Created February 25, 2016 21:31
Show Gist options
  • Save sofroniewn/0eff893d327d32741d11 to your computer and use it in GitHub Desktop.
Save sofroniewn/0eff893d327d32741d11 to your computer and use it in GitHub Desktop.
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()
})
})
@sofroniewn
Copy link
Author

image
Latencies ranged from 5 ms to 20 ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment