1int yellow=2;
2int red=5;
3int green=8;
4int blue=12;
5
6void setup() {
7
8 Serial.begin(9600);
9 pinMode(yellow,OUTPUT);
10 pinMode(red,OUTPUT);
11 pinMode(green,OUTPUT);
12 pinMode(blue,OUTPUT);
13}
14
15void loop() {
16
17 int a = random(1,5);
18
19 switch(a){
20 case 1:
21 digitalWrite(yellow,HIGH);
22 delay(1000);
23 digitalWrite(yellow,LOW);
24 break;
25
26 case 2:
27 digitalWrite(red,HIGH);
28 delay(1000);
29 digitalWrite(red,LOW);
30 break;
31
32 case 3:
33 digitalWrite(green,HIGH);
34 delay(1000);
35 digitalWrite(green,LOW);
36 break;
37
38 case 4:
39 digitalWrite(blue,HIGH);
40 delay(1000);
41 digitalWrite(blue,LOW);
42 break;
43 }
44}