Raspberry Pi Pico practice problem · Raspberry Pi Pico
Read a channel
MediumBudget $9MicroPython
An MCP3008 10-bit ADC is on the Pico's SPI:
- GP18 → CLK, GP19 → DIN, GP16 → DOUT, GP17 → CS
- VDD and VREF on 3V3, both grounds on GND
- CH0 on a 10 kΩ/10 kΩ divider, so it sees about 1.65 V
Pull CS low, send three bytes — 0x01, 0x80 (single-ended, channel 0), 0x00 — and read three back. The 10-bit code is ((reply[1] & 0x03) << 8) | reply[2]; print it. It should be about 512.