Skip to content

Instantly share code, notes, and snippets.

@mikaelleven
Created December 10, 2015 20:14
Embed
What would you like to do?
NodeJS loopback example for troubleshooting SPI communication on Raspberry Pi GPIO
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