Skip to content

Instantly share code, notes, and snippets.

@sofroniewn
Created February 24, 2016 02:05
Show Gist options
  • Save sofroniewn/ab83cb8d08bab291f529 to your computer and use it in GitHub Desktop.
Save sofroniewn/ab83cb8d08bab291f529 to your computer and use it in GitHub Desktop.
var Board = require('firmata')
var board = new Board('/dev/cu.usbmodem1411')
board.on('ready', function() {
console.log('Board ready')
board.pinMode(12, board.MODES.OUTPUT)
board.pinMode(9, board.MODES.INPUT)
var state = 0;
board.digitalRead(9, function () {
board.digitalWrite(12, (state ^= 1))
})
})
@sofroniewn
Copy link
Author

3b18d280-98bb-44f0-8583-f3672b2dcd47

In general there was a 4 - 6 ms lag between flipping of the switch (yellow trace) and turning on of the output pin (blue trace). Note time division are 1 ms

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