]> git.piffa.net Git - sketchbook_andrea/blob - multitasking/blink_0_soluzione/blink_0_soluzione.ino
cleanup multitasking
[sketchbook_andrea] / multitasking / blink_0_soluzione / blink_0_soluzione.ino
1 /*
2   Blink due LED - Soluzione
3
4  */
5
6 // Pin 13 has an LED connected on most Arduino boards.
7 // give it a name:
8 int ledA = 13; //Primo LED
9 int ledB = 12; //Secondo LED
10
11 // the setup routine runs once when you press reset:
12 void setup() {                
13   // initialize the digital pin as an output.
14   pinMode(ledA, OUTPUT);    
15   pinMode(ledB, OUTPUT);  
16 }
17
18 // the loop routine runs over and over again forever:
19 void loop() {
20   digitalWrite(ledA, HIGH);   // turn the LED on (HIGH is the voltage level)
21   digitalWrite(ledB, HIGH);
22
23   delay(500);               
24   digitalWrite(ledB, LOW);
25
26   delay(500);
27   digitalWrite(ledA, LOW);
28   digitalWrite(ledB, HIGH);
29
30
31   delay(500);               
32   digitalWrite(ledB, LOW);
33
34   delay(500);
35   digitalWrite(ledA, LOW);
36   digitalWrite(ledB, LOW);
37   ;
38 }
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54