A Raspberry Pi Pico W (RP2040) firmware project that reads a 4x4 matrix keypad and controls 12 LEDs using Arduino-style C++ logic.
Scope of this repository refresh: Documentation and project organization were improved while preserving the original runtime behavior in
src/main.cpp.
.
├── CMakeLists.txt
├── diagram.json
├── include/
│ └── .gitkeep
├── src/
│ └── main.cpp
└── docs/
├── architecture.md
└── wiring.md
- 4x4 matrix keypad input via
Keypadlibrary. - 12 independent LED outputs.
- Group actions:
9: turn ON LEDs 1..80: turn OFF LEDs 1..8*: turn ON LEDs A..D#: turn OFF LEDs A..D
- Direct actions:
1..8: turn ON individual blue LEDsA..D: turn ON individual red LEDs
- 1x Raspberry Pi Pico / Pico W-compatible RP2040 board footprint
- 1x 4x4 membrane keypad
- 12x LEDs (8 blue, 4 red)
- 12x 220Ω resistors (LED current limiting)
- 4x 1kΩ resistors (keypad row pull-up network)
- Jumper wires and USB power/programming cable
- Keypad columns: GP16, GP17, GP18, GP19
- Keypad rows: GP26, GP22, GP21, GP20
- LED outputs: GP11, GP10, GP9, GP8, GP7, GP6, GP5, GP4, GP3, GP2, GP28, GP27
For the full table and physical signal mapping, see docs/wiring.md.
- Create/open a Raspberry Pi Pico project in Wokwi.
- Replace Wokwi
diagram.jsonwith this repo'sdiagram.json. - Replace the sketch source with
src/main.cpp. - Add/install library Keypad in Wokwi's library manager.
- Start simulation and press keypad keys to verify LED behavior.
- Install Arduino IDE 2.x.
- Install the RP2040 board package (Earle Philhower core).
- Install library: Keypad (Mark Stanley / Alexander Brevig).
- Open/use
src/main.cppas your sketch content. - Select board: Raspberry Pi Pico W.
- Enter BOOTSEL mode if needed and upload.
This code is Arduino-API-based (setup, loop, digitalWrite, Keypad.h).
If you use pure Pico SDK, preserve logic and add a thin adaptation layer.
- Pico W Wi-Fi hardware is not used in this firmware.
- No SSID/password or cloud credentials are required.
- Do not hardcode credentials if you later extend this project with networking.
src/main.cpp intentionally retains the provided control logic without behavioral changes.