A bare-metal embedded C exercise for the STM32L476RG (Nucleo-64) that scans a 4×3 matrix keypad and displays the pressed key's value as a binary pattern on three LEDs. GPIO is configured at the register level.
- Configures
PC0–PC2as outputs (3-bit LED display) and the keypad rows (PC4–PC7) and columns (PC8–PC10) as a scanned matrix. - Reads the keypad by driving columns and sensing rows, mapping the active
row/column to a key via a lookup table (
1–9,*,0,#). - Shows the detected key on the LEDs.
- STM32L476RG (Nucleo-64)
- 4×3 matrix keypad on
PC4–PC10, 3 LEDs onPC0–PC2
Generated from STM32CubeMX with a CMake build. Build with the included CMake
presets and an arm-none-eabi toolchain, or open in STM32CubeIDE, then flash.
Coursework from an embedded systems course at Cal Poly, San Luis Obispo. The
main.c application logic is my own work. The project also bundles
STMicroelectronics' STM32L4xx HAL/CMSIS drivers and CubeMX-generated files, which
are under ST's own license terms and are not mine to relicense.
Shared as a learning reference only. It is intentionally not released under an open-source license, and you should not submit it as your own work for a graded assignment.