KevsRobots Learning Platform
By Kevin McAleer, 2 Minutes
Page last updated June 15, 2025

It’s time to bring everything together!
In this lesson, you’ll build your first real hardware project: a blinking LED using the Raspberry Pi Pico and C.
This is the “Hello World” of embedded programming — and it’s just the beginning.
You’ll connect an LED to a GPIO pin and write a C program that blinks it on and off every second.
\[Pico GPIO 15] ---\[LED]---\[330Ω]---\[GND]
Your program will:
blink.c#include "pico/stdlib.h"
int main() {
const uint LED_PIN = 15;
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
while (true) {
gpio_put(LED_PIN, 1); // Turn LED on
sleep_ms(1000);
gpio_put(LED_PIN, 0); // Turn LED off
sleep_ms(1000);
}
}
CMakeLists.txt similar to earlier lessons.Compile your project:
mkdir build
cd build
cmake ..
make
blink.uf2 file to the RPI-RP2 drive🎉 The LED should start blinking!
for loop to blink 10 times, then stopYou’ve now:
Next up: Course Summary and Next Steps
You can use the arrows ← → on your keyboard to navigate between lessons.
Comments