PyRasp

← All practice problems

Raspberry Pi Pico practice problem · Raspberry Pi Pico

Colour mixer

HardBudget $9MicroPython

A potentiometer on GP26 selects a colour on an RGB LED (red GP20, green GP21, blue GP22, through 220 Ω resistors):

  • below 33 %: red,
  • 33–66 %: green,
  • above 66 %: blue.

Only the selected channel is on. The test starts at 10 %, then 50 %, 90 %, 35 % and 70 %, so the boundaries are checked on both sides.

More in Raspberry Pi Pico