Created
February 24, 2016 02:05
-
-
Save sofroniewn/ab83cb8d08bab291f529 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 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)) | |
| }) | |
| }) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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