LEVEL 01 / LESSON 10

Practical Mini Project

Build a simple push-button input and LED output experiment on an STM32 development board. The goal is to connect voltage levels, pull resistors, GPIO configuration and firmware behavior.

01 / PRACTICAL LAB

Push button → GPIO → LED

Build a simple push-button input and LED output experiment on an STM32 development board. The goal is to connect voltage levels, pull resistors, GPIO configuration and firmware behavior.

HARDWARE

MCU board, push button, LED/resistor and jumper wires.

FIRMWARE

Configure one GPIO as input and another as output.

OBSERVE

Press the button and verify the output transition.

DEBUG

Check pin mode, pull configuration and actual voltage.

  1. Configure an input pin
  2. Use an internal pull-up or pull-down where appropriate
  3. Configure an LED output
  4. Read the input and change the output
  5. Verify the signal with a meter or logic analyzer
gpio_lab.c
// V1.3 lab skeleton
int main(void)
{
    // Configure input GPIO
    // Configure output GPIO
    while (1)
    {
        // Read button → drive LED
    }
}
KEY TAKEAWAY

Always verify both firmware configuration and the physical electrical state.