PyRasp

← All practice problems

Raspberry Pi Pico practice problem · Raspberry Pi Pico

Sticky dimmer

HardBudget $6MicroPython

A potentiometer on GP26 controls an LED on GP13 with hysteresis:

  • above 70 % of the range: LED on,
  • below 30 %: LED off,
  • in between: keep whatever it was.

So turning from 80 % down to 50 % leaves it on, and turning from 10 % up to 50 % leaves it off.

More in Raspberry Pi Pico