NodeJS loopback example for troubleshooting SPI communication on Raspberry Pi GPIO
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 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