Created
December 10, 2015 20:14
-
-
Save mikaelleven/75b0deb1ac0be4c8a3f8 to your computer and use it in GitHub Desktop.
NodeJS loopback example for troubleshooting SPI communication on Raspberry Pi GPIO
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 rpio = require('rpio'); | |
var rxBuffer = rpio.spiTransfer(new Buffer('HELLOSPI'), 8); | |
for (var i = 0; i <= 7; i++) { | |
process.stdout.write(String.fromCharCode(rxBuffer[i]) + (i == 7 ? '\n' : ' ')); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment