-
-
Save dannyfritz/cade2d0d674d5bf01526 to your computer and use it in GitHub Desktop.
This file contains 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() { | |
this.pinMode(6, 0); | |
var pin = new five.Pin(6); | |
pin.on('high', function () { | |
console.log('motion!'); | |
}); | |
pin.on('low', function () { | |
console.log('no motion!'); | |
}); | |
pin.on('data', function () { | |
console.log(pin.value); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment