PyRasp

← All practice problems

Raspberry Pi Pico practice problem · Raspberry Pi Pico

Reaction game

HardBudget $5MicroPython

Two players, two buttons (GP12 for player 1, GP13 for player 2) and an LED on GP16.

Each round: the LED waits one second, then lights. The first player to press after that wins: print player 1 or player 2, then turn the LED off. After a one-second pause the next round starts. The test has player 1 win the first round and player 2 win the second.

More in Raspberry Pi Pico