KevsRobots Learning Platform
90% Percent Complete
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