Hi, I’m using jetson nano.
I want to use mcp 3008 in jetson, but it does not work. Output is zero. I used examples from the library and library in Adafruit. The circuit connection was good according to the pin map, and the spi connection was activated.
There are a few people running this code in Raspberry Pie and Jetson nano. What is my problem? Please help me…
import time import busio import digitalio import board import adafruit_mcp3xxx.mcp3008 as MCP from adafruit_mcp3xxx.analog_in import AnalogIn # create the spi bus) spi = busio.SPI(clock=board.SCK, MISO=board.MISO, MOSI=board.MOSI) # create the cs (chip select) cs = digitalio.DigitalInOut(board.CE0) # create the mcp object mcp = MCP.MCP3008(spi, cs) # create an analog input channel on pin 0 chan = AnalogIn(mcp, MCP.P0) while True: print('Raw ADC Value: ', chan.value) print('ADC Voltage: ' + str(chan.voltage) + 'V') time.sleep(0.5)