PyRaspBeta

← All practice problems

Raspberry Pi practice problem · LEDs & PWM

Triple flash

EasyBudget $2Python · gpiozero

Flash an LED on GPIO22 in groups of three, like a warning beacon:

  • three flashes: 0.15 s on, 0.15 s off, three times (0.9 s)
  • then dark for 1.1 s
  • repeat, so a new group starts every 2 s (at 0 s, 2 s, 4 s, …)

Tip: a for loop inside a while True loop.

More in LEDs & PWM