PyRaspBeta

← All practice problems

Raspberry Pi practice problem · Projects

Quiz show

HardBudget $10Python · gpiozero

A quiz-show buzzer for three players: buttons on GPIO5, GPIO6 and GPIO13 (players 1–3), each player's LED on GPIO17, GPIO27 and GPIO22, a host reset button on GPIO26 and an active buzzer on GPIO25 (may draw up to 25 mA).

  • The first player to press in a round wins it: their LED lights, the buzzer beeps for 0.3 s, they score a point, and the program prints Player 2 (score 1).
  • Until the host resets, every other press is ignored.
  • Reset turns all LEDs off and starts a new round. Only a new press counts: a button that was already held down before the reset doesn't win.

The test: player 2 presses at 1 s; player 1 at 1.5 s; player 1 presses at 2.5 s and holds until 5.5 s; reset at 3 s; player 3 presses at 4 s; reset at 6 s; player 2 presses at 6.5 s.

More in Projects