This is a simple script that reads all eight analog channels of an MCP3008 each second and outputs the result to the console.
I created this script to ease debugging of the MCP3008 ADC connected to my Raspberry Pi.
If you need to troubleshoot the SPI connection in itself you can check out my guide how to test SPI through the loopback "debug mode" https://mikaelleven.wordpress.com/2015/12/10/troubleshooting-spi-on-raspberry-pi-nodejs/.
Download this gist and run the following command
npm install rpio
sudo node spi_dump.js
+1