PyRaspBeta

← All practice problems

Raspberry Pi practice problem · Displays

Segment thermometer

MediumBudget $15Python · gpiozero

A DS18B20 thermometer on GPIO4 (the probe module has its pull-up) and a TM1637 display (CLK GPIO23, DIO GPIO24, 3.3 V). Show the temperature rounded to the nearest whole degree, followed by C, right-aligned: 21.4 °C shows 21C, −3.6 °C shows -4C. Keep updating.

Each DS18B20 reading takes 0.75 s. The test: 21.4 °C, −3.6 °C at 3 s, 8.2 °C at 6 s.

More in Displays