import busio
import digitalio
import board
import adafruit_mcp3xxx.mcp3002 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.D5)

# create the mcp object
mcp = MCP.MCP3002(spi, cs)

# create an analog input channel on pin 0
chan = AnalogIn(mcp, MCP.P0)

print("Raw ADC Value: ", chan.value)
print("ADC Voltage: " + str(chan.voltage) + "V")

[(8, 'busio.SPI', 'busio.SPI', False, 'import busio\n'), (11, 'digitalio.DigitalInOut', 'digitalio.DigitalInOut', False, 'import digitalio\n'), (14, 'adafruit_mcp3xxx.mcp3002.MCP3002', 'MCP.MCP3002', True, 'import adafruit_mcp3xxx.mcp3002 as MCP\n'), (17, 'adafruit_mcp3xxx.analog_in.AnalogIn', 'AnalogIn', False, 'from adafruit_mcp3xxx.analog_in import AnalogIn\n')]