-
Notifications
You must be signed in to change notification settings - Fork 0
/
Edited_RGB_Sketch.ino
47 lines (44 loc) · 971 Bytes
/
Edited_RGB_Sketch.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
int redPin = 11;
int greenPin = 10;
int bluePin = 9;
void setup()
{
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop()
{
setColor(255, 0, 0); // red
delay(1000);
setColor(0, 255, 0); // green
delay(1000);
setColor(0, 0, 255); // blue
delay(1000);
setColor(255, 255, 0); // yellow
delay(1000);
setColor(80, 0, 80); // purple
delay(1000);
setColor(0, 255, 255); // aqua
delay(1000);
setColor(6, 25, 88); // White
delay(1000);
setColor(255, 165, 0); //Orange
delay(1000);
setColor(186, 85, 211);
delay(1000);
setColor(159,182, 205); // slategray 3
delay(1000);
setColor(0, 134, 139); // turquoise 4
delay(1000);
setColor(0, 201, 87); // emeraldgreen
delay(1000);
setColor(255, 255, 255); //off
delay(2000);
}
void setColor(int red, int green, int blue)
{
analogWrite(redPin, 255-red);
analogWrite(greenPin, 255-green);
analogWrite(bluePin, 255-blue);
}