Switchboard

A control panel has two switches and two indicator LEDs. The switches are wired to GPIOB (PB0 and PB1), and the LEDs are wired to GPIOA (PA5 and PA6). Your job: read the switch states and mirror them to the corresponding LEDs.

Pin assignments:

  • PB0 (input) -> PA5 (output)
  • PB1 (input) -> PA6 (output)

When PB0 goes high, PA5 should go high. When PB0 goes low, PA5 should go low. Same for PB1 and PA6.

The platform records every transition on PA5 and PA6 like a logic analyzer. Each test drives each switch high then low once, so each LED must produce exactly one rising and one falling transition. Spurious toggles, including any during initialization, fail the check.

The starter code provides register definitions for both GPIO ports. You need to enable the port clocks, configure pin directions, and poll the input pins in a loop.

Loading the interactive arena.