PyRaspBeta

← All practice problems

Raspberry Pi practice problem · Displays

Scanner

MediumBudget $10Python · gpiozero

A NeoPixel stick (8 LEDs, DIN on GPIO18, 5 V). One red pixel (255, 0, 0) bounces back and forth, like a scanner; all others are off.

It moves one place every 0.5 s: pixel 0 at 0 s, 1 at 0.5 s, … 7 at 3.5 s, then back: 6 at 4 s, … 0 at 7 s, and so on forever.

More in Displays