-
Notifications
You must be signed in to change notification settings - Fork 0
/
RGB_LED_Strip_Controller_PWM.ino
32 lines (29 loc) · 1.11 KB
/
RGB_LED_Strip_Controller_PWM.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//The Workshop - LED Strip Controller Test V0.1
//Use this code to test your RGB LED strip controller
//Match every color with its corresponsing pin
//PS: Make sure the pins can handle PWM!
int Red=3;
int Green=5;
int Blue=6;
void setup() {
// put your setup code here, to run once:
analogWrite(Red,0); //Turn OFF the RED Light
analogWrite(Green,0); //Turn OFF the GREEN Light
analogWrite(Blue,0); //Turn OFF the BLUE Light
delay(500);
}
void loop() {
// put your main code here, to run repeatedly:
analogWrite(Red,255); //Turn ON the RED Light
analogWrite(Green,0); //Turn OFF the GREEN Light
analogWrite(Blue,0); //Turn OFF the BLUE Light
delay(1000); // WAIT for 1000ms (1s)
analogWrite(Red,0); //Turn OFF the RED Light
analogWrite(Green,255); //Turn ON the GREEN Light
analogWrite(Blue,0); //Turn OFF the BLUE Light
delay(1000); // WAIT for 1000ms (1s)
analogWrite(Red,0); //Turn OFF the RED Light
analogWrite(Green,0); //Turn OFF the GREEN Light
analogWrite(Blue,255); //Turn ON the BLUE Light
delay(1000); // WAIT for 1000ms (1s)
}