Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 875 Bytes

File metadata and controls

35 lines (24 loc) · 875 Bytes

Exercise A: arrow controller

Objective

Translate one-character serial commands into four LED outputs. This introduces Serial.available(), Serial.read(), functions, and a safe default state.

Wiring

Connect each pin through its own 220–330 Ω resistor to an LED anode; connect each LED cathode to ground.

Meaning Uno pin
Up 2
Left 3
Right 4
Down 5

Commands

Q = up-left, E = up-right, Z = down-left, C = down-right, and X (or any unknown character) = off.

Verify

  1. Send every documented command once.
  2. Confirm the two expected LEDs and serial message.
  3. Send an unknown character and confirm all LEDs turn off.
  4. Leave the sketch idle and confirm it does not repeatedly print.

Challenge

Add W, A, S, and D for single-direction output without duplicating the pin-writing logic.