-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3_rgb_analog.ino
More file actions
50 lines (39 loc) · 844 Bytes
/
3_rgb_analog.ino
File metadata and controls
50 lines (39 loc) · 844 Bytes
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
48
49
50
/*
Morse code sheet: https://drive.google.com/file/d/1liBuEK5mu3E04ymCv_On7b9cEDAkBJO1/view
Challenges:
1) Make police car light pattern
2) Red Blink, Green Blink, Blue Blink
3) Colors of the rainbow (ROYGBIV)
Color guide: https://www.rapidtables.com/web/color/RGB_Color.html
*/
#define RED 3
#define BLUE 5
#define GREEN 6
void setup() {
pinMode(RED,OUTPUT); //- RED
pinMode(BLUE,OUTPUT); //- BLUE
pinMode(GREEN,OUTPUT); //- GREEN
pinMode(7,OUTPUT);
}
void dot() {
digitalWrite(7,HIGH);
delay(100);
digitalWrite(7,LOW);
delay(100);
}
void dash() {
digitalWrite(7,HIGH);
delay(300);
digitalWrite(7,LOW);
delay(100);
}
void rgbOff() {
digitalWrite(RED,LOW);
digitalWrite(BLUE,LOW);
digitalWrite(GREEN,LOW);
}
void loop() {
analogWrite(RED,255);
analogWrite(BLUE,0);
analogWrite(GREEN,255);
}