Raspberry Pi practice problem · Buttons & input
Start and stop
EasyBudget $4Python · gpiozero
Machines use two buttons: Start latches the machine on, Stop switches it off. The light stays as it is after you let go.
- Start button on GPIO5, Stop button on GPIO6 (both to ground)
- a "running" LED on GPIO17
Pressing Start while running, or Stop while stopped, changes nothing. The test presses Start at 1 s, Stop at 3 s, Stop again at 4 s, Start at 5 s and Start again at 6 s.