I am trying to create a voltage sensor using a Raspberry Pi 3 with Raspbian (February 2017 release because that is the one I need for the rest of my project) by connecting the SPI pins to an MCP3008 ADC, but when I try to run this code (http://osoyoo.com/driver/voltage.py), I always get an output of 0.00 V. I followed the tutorial where this code came from:
I have tried using different Pis (a Pi Zero W instead of a 3), different versions of Raspbian, different pins and even different MCP3008 chips but to no avail. I am starting to believe that the SD card or something might be bad because I cannot understand where I am going wrong. I have also tried various other Pi-to-MCP3008 to get something that works, but that hasn't panned out well either. I am really trying to use the software configuration (discussed here: https://learn.adafruit.com/raspberry-pi-analog-to-digital-converters/mcp3008)
If anyone could please let me know if there is an issue in the code or circuit design, or if there is some other method I could follow to attain these results, I would be incredibly thankful.