Created
February 26, 2016 03:50
-
-
Save sofroniewn/2c02920034d2f2f919a1 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
| console.log('Hello Pi') | |
| var raspi = require('raspi') | |
| var gpio = require('raspi-gpio') | |
| var NanoTimer = require('nanotimer') | |
| var timer = new NanoTimer() | |
| raspi.init(function() { | |
| console.log('Board-ready') | |
| var input = new gpio.DigitalInput(2) | |
| var output = new gpio.DigitalOutput(0) | |
| timer.setInterval(function() { | |
| output.write(input.read()) | |
| }, '','10u') | |
| }) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reliable latencies of 25 us - 75 us using raspi and nanotimer