Guest Post Disclaimer
This is a guest post by the EasyEDA team. I would like to thank EasyEDA for providing this tutorial for everyone to enjoy. All information within this post was provided by EasyEDA.
Description
Parts Required:
Image source: EasyEDA
Arduino Libraries and IDE
No libraries are required for this project. The Arduino IDE can be downloaded from the Arduino website. Here is the download link.
ARDUINO CODE:
//RGB5050_light_cross sketch provided by EasyEDA for the LED scroll bar project. | |
int RGB1 =12; //Define digital interface | |
int RGB2 =11; //Define digital interface | |
int RGB3 =10; //Define digital interface | |
int RGB4 =9; //Define digital interface | |
int RGB5 =8; //Define digital interface | |
int RGB6 =7; //Define digital interface | |
int RGB7 =6; //Define digital interface | |
int RGB8 =5; //Define digital interface | |
int RGB9 =4; //Define digital interface | |
int RGB10 =3; //Define digital interface | |
// Pin definition | |
int key1 =A3; //Define digital A3 interface | |
int key2 =A2; //Define digital A3 interface | |
int key3 =A1; //Define digital A3 interface | |
int key4 =A0; //Define digital A3 interface | |
void setup(){ | |
//Enable serial port function, set the corresponding parameters | |
Serial.begin(9600); | |
pinMode(RGB1, OUTPUT);//Fixed Q1 interface for output interface | |
pinMode(RGB2, OUTPUT); //Fixed Q2 interface for output interface | |
pinMode(RGB3, OUTPUT); //Fixed Q3 interface for output interface | |
pinMode(RGB4, OUTPUT);//Fixed Q4 interface for output interface | |
pinMode(RGB5, OUTPUT); //Fixed Q5 interface for output interface | |
pinMode(RGB6, OUTPUT); //Fixed Q6 interface for output interface | |
pinMode(RGB7, OUTPUT);//Fixed Q7 interface for output interface | |
pinMode(RGB8, OUTPUT); //Fixed Q8 interface for output interface | |
pinMode(RGB9, OUTPUT); //Fixed Q9 interface for output interface | |
pinMode(RGB10, OUTPUT); //Fixed Q10 interface for output interface | |
pinMode(key1, INPUT_PULLUP); | |
pinMode(key2, INPUT_PULLUP); | |
pinMode(key3, INPUT_PULLUP); | |
pinMode(key4, INPUT_PULLUP); | |
} | |
void loop(){ | |
//Read key state values | |
int key1Value = analogRead(key1); | |
int key2Value = analogRead(key2); | |
int key3Value = analogRead(key3); | |
int key4Value = analogRead(key4); | |
if (key1Value <= 100){ | |
delay(30); | |
if (key1Value <= 100){ | |
digitalWrite(RGB5,HIGH);//Light | |
digitalWrite(RGB6, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB4, HIGH);//Light | |
digitalWrite(RGB7,HIGH);//Light | |
delay(50); | |
digitalWrite(RGB3, HIGH);//Light | |
digitalWrite(RGB8, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB2,HIGH);//Light | |
digitalWrite(RGB9, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB1, HIGH);//Light | |
digitalWrite(RGB10, HIGH);//Light | |
delay(1000); | |
} else { | |
// Output the final result of the led to the corresponding pin | |
digitalWrite(RGB1, LOW); //Go out | |
digitalWrite(RGB2, LOW);//Go out | |
digitalWrite(RGB3, LOW);//Go out | |
digitalWrite(RGB4, LOW); //Go out | |
digitalWrite(RGB5, LOW);//Go out | |
digitalWrite(RGB6, LOW);//Go out | |
digitalWrite(RGB7, LOW); //Go out | |
digitalWrite(RGB8, LOW);//Go out | |
digitalWrite(RGB9, LOW);//Go out | |
digitalWrite(RGB10, LOW);//Go out | |
} | |
} | |
if (key2Value <= 100){ | |
digitalWrite(RGB1,HIGH);//Light | |
digitalWrite(RGB6, HIGH);//Light | |
delay(40); | |
digitalWrite(RGB2, HIGH);//Light | |
digitalWrite(RGB7,HIGH);//Light | |
delay(40); | |
digitalWrite(RGB3, HIGH);//Light | |
digitalWrite(RGB8, HIGH);//Light | |
delay(40); | |
digitalWrite(RGB4,HIGH);//Light | |
digitalWrite(RGB9, HIGH);//Light | |
delay(40); | |
digitalWrite(RGB5, HIGH);//Light | |
digitalWrite(RGB10, HIGH);//Light | |
delay(1000); | |
} else { | |
// Output the final result of the led to the corresponding pin | |
digitalWrite(RGB1, LOW); //Go out | |
digitalWrite(RGB2, LOW);//Go out | |
digitalWrite(RGB3, LOW);//Go out | |
digitalWrite(RGB4, LOW); //Go out | |
digitalWrite(RGB5, LOW);//Go out | |
digitalWrite(RGB6, LOW);//Go out | |
digitalWrite(RGB7, LOW); //Go out | |
digitalWrite(RGB8, LOW);//Go out | |
digitalWrite(RGB9, LOW);//Go out | |
digitalWrite(RGB10, LOW);//Go out | |
} | |
if (key3Value <= 100) { | |
digitalWrite(RGB1,HIGH);//Light | |
delay(90); | |
digitalWrite(RGB1, LOW); //Go out | |
digitalWrite(RGB2, HIGH);//Light | |
delay(90); | |
digitalWrite(RGB2, LOW);//Go out | |
digitalWrite(RGB3, HIGH);//Light | |
delay(90); | |
digitalWrite(RGB3, LOW);//Go out | |
digitalWrite(RGB4, HIGH);//Light | |
delay(90); | |
digitalWrite(RGB4, LOW); //Go out | |
digitalWrite(RGB5,HIGH);//Light | |
delay(90); | |
digitalWrite(RGB5, LOW);//Go out | |
digitalWrite(RGB6,HIGH);//Light | |
delay(90); | |
digitalWrite(RGB6, LOW);//Go out | |
digitalWrite(RGB7,HIGH);//Light | |
delay(90); | |
digitalWrite(RGB7, LOW);//Go out | |
digitalWrite(RGB8,HIGH);//Light | |
delay(90); | |
digitalWrite(RGB8, LOW);//Go out | |
digitalWrite(RGB9,HIGH);//Light | |
delay(90); | |
digitalWrite(RGB9, LOW);//Go out | |
digitalWrite(RGB10,HIGH);//Light | |
delay(1000); | |
} else { | |
//Output the final result of the led to the corresponding pin | |
digitalWrite(RGB1, LOW); //Go out | |
digitalWrite(RGB2, LOW);//Go out | |
digitalWrite(RGB3, LOW);//Go out | |
digitalWrite(RGB4, LOW); //Go out | |
digitalWrite(RGB5, LOW);//Go out | |
digitalWrite(RGB6, LOW);//Go out | |
digitalWrite(RGB7, LOW); //Go out | |
digitalWrite(RGB8, LOW);//Go out | |
digitalWrite(RGB9, LOW);//Go out | |
digitalWrite(RGB10, LOW);//Go out | |
} | |
if (key4Value <= 100){ | |
digitalWrite(RGB1,HIGH);//Light | |
delay(50); | |
digitalWrite(RGB1, LOW); //Go out | |
digitalWrite(RGB2, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB2, LOW); //Go out | |
digitalWrite(RGB3, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB3, LOW); //Go out | |
digitalWrite(RGB4,HIGH);//Light | |
delay(50); | |
digitalWrite(RGB4, LOW); //Go out | |
digitalWrite(RGB5, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB5, LOW); //Go out | |
digitalWrite(RGB6, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB6, LOW); //Go out | |
digitalWrite(RGB7,HIGH);//Light | |
delay(50); | |
digitalWrite(RGB7, LOW); //Go out | |
digitalWrite(RGB8, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB8, LOW); //Go out | |
digitalWrite(RGB9, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB9, LOW); //Go out | |
digitalWrite(RGB10,HIGH);//Light | |
delay(50); | |
digitalWrite(RGB10, LOW); //Go out | |
digitalWrite(RGB9, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB9, LOW); //Go out | |
digitalWrite(RGB8, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB8, LOW); //Go out | |
digitalWrite(RGB7,HIGH);//Light | |
delay(50); | |
digitalWrite(RGB7, LOW); //Go out | |
digitalWrite(RGB6, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB6, LOW); //Go out | |
digitalWrite(RGB5, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB5, LOW); //Go out | |
digitalWrite(RGB4,HIGH);//Light | |
delay(50); | |
digitalWrite(RGB4, LOW); //Go out | |
digitalWrite(RGB3, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB3, LOW); //Go out | |
digitalWrite(RGB2, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB2, LOW); //Go out | |
digitalWrite(RGB1, HIGH);//Light | |
delay(50); | |
digitalWrite(RGB1, LOW); //Go out | |
delay(1000); | |
} else { | |
//Output the final result of the led to the corresponding pin | |
digitalWrite(RGB1, LOW); //Go out | |
digitalWrite(RGB2, LOW);//Go out | |
digitalWrite(RGB3, LOW);//Go out | |
digitalWrite(RGB4, LOW); //Go out | |
digitalWrite(RGB5, LOW);//Go out | |
digitalWrite(RGB6, LOW);//Go out | |
digitalWrite(RGB7, LOW); //Go out | |
digitalWrite(RGB8, LOW);//Go out | |
digitalWrite(RGB9, LOW);//Go out | |
digitalWrite(RGB10, LOW);//Go out | |
} | |
} |
Preparing the LED strips
Image source: EasyEDA
Designing the Control Board
I have made a custom control board that incorporates an Arduino Nano. The control board is used to boost the incoming signal from Arduino and lights up the corresponding LED strips.
Image source: EasyEDA
Control Board Circuit diagram
Schematic
You can access the actual EasyEDA schematic by clicking on the image below:Image source: EasyEDA
PCB Board Design
Here is the PCB board design for this project.
You can access the actual EasyEDA design by clicking on the image below.
Image source: EasyEDA
PCB Fabrication
After completing the PCB design, you can click on the Fabrication icon.
You will then have access to the PCB order page which will allow you to download your PCB Gerber files that can be sent to any manufacturer. However it is a lot easier (and cheaper) to order it directly from EasyEDA.
Here you can select:
- the number of PCBs you want to order
- the number of copper layers you need
- the PCB thickness
- copper weight
- and even the PCB color
Image source: EasyEDA
PCB final product
When I received the PCBs, I am quite impressed with the quality, they are pretty nice.
Image source: EasyEDA
PCB Build of Materials
Image source: EasyEDA
PCB connections
Image source: EasyEDA
Project Video
Concluding comments
Hope you like this RGB light effects project, do try it out and post your feedback below.
Disclaimer:
This is a guest blog post by the EasyEDA team. All information within this post was provided by EasyEDA.
0 comments:
Post a Comment