RGB LED color mixing
📖 Scenario: You have a small RGB LED connected to your Raspberry Pi. Each color (Red, Green, Blue) can be turned on or off by setting the GPIO pins high or low. You want to create different colors by mixing these three basic colors.
🎯 Goal: Write a program that controls the RGB LED by turning on or off the red, green, and blue pins to create a specific color.
📋 What You'll Learn
Create variables for the GPIO pins connected to the red, green, and blue parts of the LED.
Set up the GPIO pins as outputs.
Write code to turn on the red and green pins and turn off the blue pin to create yellow color.
Print the current color being displayed.
💡 Why This Matters
🌍 Real World
RGB LEDs are used in many devices for colorful lighting effects, status indicators, and decorations.
💼 Career
Understanding how to control hardware like LEDs with code is important for jobs in embedded systems, IoT, and hardware prototyping.
Progress0 / 4 steps