2-Color LED Module
The 2-Color LED Module project demonstrates how to control a bi-color LED using an Arduino Mega. Bi-color LEDs, which contain two LEDs of different colors in a single package, are useful for indicating multiple states in various applications. This project will alternate between turning on the red and green LEDs with a defined delay, showing how to manage dual LEDs for status indication or simple visual effects.
Components Needed
- Arduino Mega
- 2-Color LED Module (Red and Green)
- Jumper Wires
- Breadboard
- Power Supply
Block Diagram
Circuit Setup
Connect the 2-Color LED Module to Arduino Mega:
Connect the red LED pin of the module to digital pin 9 on the Arduino Mega.
Connect the green LED pin of the module to digital pin 10 on the Arduino Mega.
Connect the common cathode or anode of the LED module to GND or VCC accordingly.
Instructions
Circuit Setup:
Wire the 2-color LED module to the Arduino Mega as described in the circuit setup section.
Code Upload:
Open the Arduino IDE and paste the provided code.
Upload the code to the Arduino Mega.
Testing:
Once the code is uploaded, the LED should alternate between red and green colors with a one-second delay.
Open the serial monitor to see the status messages indicating which LED is currently on.
Applications
Notes
Ensure the correct connection of the common terminal (cathode or anode) of the bi-color LED module based on its type.
Adjust the delay time as needed to change the rate of color switching.
Experiment with additional functions to create more complex lighting patterns or behaviors.