Single LED control
📖 Scenario: You have a Raspberry Pi and a single LED connected to GPIO pin 17. You want to control this LED by turning it on and off using a simple Python program.
🎯 Goal: Build a Python program that sets up the GPIO pin, turns the LED on, waits for 2 seconds, then turns the LED off.
📋 What You'll Learn
Use the RPi.GPIO library to control the GPIO pins
Set GPIO mode to BCM
Set up GPIO pin 17 as an output
Turn the LED on by setting pin 17 to HIGH
Wait for 2 seconds
Turn the LED off by setting pin 17 to LOW
Clean up the GPIO settings at the end
💡 Why This Matters
🌍 Real World
Controlling LEDs is a basic skill for Raspberry Pi projects like indicators, alerts, or simple light displays.
💼 Career
Understanding GPIO control is essential for hardware interfacing roles, embedded systems, and IoT development.
Progress0 / 4 steps