1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| | ###
#define cR 5
#define cG 6
#define cB 7
void setup() {
pinMode(cR, OUTPUT);
pinMode(cG, OUTPUT);
pinMode(cB, OUTPUT);
digitalWrite(cR, LOW);
digitalWrite(cG, LOW);
digitalWrite(cB, LOW);
}
void loop() {
analogWrite(cR, 127); delay(1000); analogWrite(cR, 255);
analogWrite(cB, 0); delay(1000); analogWrite(cR, 127);
analogWrite(cG, 255); delay(1000);
analogWrite(cR, 0); delay(1000);
analogWrite(cB, 255); delay(1000);
analogWrite(cG, 0); delay(1000);
}
###
|
|