PyRaspBeta

← All practice problems

Raspberry Pi practice problem · Sensors

Volt meter

EasyBudget $8Python · gpiozero

A potentiometer across 3.3 V and GND, its wiper on channel 0 of an MCP3008 ADC on the SPI pins (VREF on 3.3 V) — or the knob + ADC board. Every 0.5 s print the wiper voltage with one decimal:

1.3 V

The ADC's reading runs from 0.0 to 1.0 across 0–3.3 V. The test sets the knob to 40 %, then 70 % at 2 s.

More in Sensors