PyRasp

← All practice problems

Raspberry Pi Pico practice problem · Raspberry Pi Pico

Pedestrian crossing

HardBudget $11MicroPython

A small crossing: car red on GP13, car green on GP16, walker red on GP17, walker green on GP20, and a button on GP12.

Normally the cars are green and the walker is red. Each press:

  • cars red, walker green, for 1.5 s,
  • then back to cars green and walker red.

Only the correct pair may be lit at once. Debounce the button.

More in Raspberry Pi Pico