From: eaman Date: Mon, 20 Jun 2016 14:46:05 +0000 (+0200) Subject: Multi X-Git-Url: http://git.piffa.net/web?a=commitdiff_plain;h=43512808650a2a564b9ec7dfbbc78e6a1786a4ab;p=sketchbook_andrea Multi --- diff --git a/multitasking/blink_0_soluzione/blink_0_soluzione.ino b/multitasking/blink_0_soluzione/blink_0_soluzione.ino index e9312e0..25b4afd 100644 --- a/multitasking/blink_0_soluzione/blink_0_soluzione.ino +++ b/multitasking/blink_0_soluzione/blink_0_soluzione.ino @@ -17,8 +17,8 @@ // Pin 13 has an LED connected on most Arduino boards. // give it a name: -int ledA = 13; //Primo LED -int ledB = 12; //Secondo LED, con resistenza +const int ledA = 13; //Primo LED +const int ledB = 12; //Secondo LED, con resistenza // the setup routine runs once when you press reset: void setup() { @@ -29,27 +29,25 @@ void setup() { // the loop routine runs over and over again forever: void loop() { + // Primo periodo digitalWrite(ledA, HIGH); // turn the LED on (HIGH is the voltage level) digitalWrite(ledB, HIGH); - delay(500); // Minimo comun denominatore del periodo + + // Secondo periodo //digitalWrite(ledA, HIGH); // ledA non cambia digitalWrite(ledB, LOW); - - delay(500); + + // Terzo periodo digitalWrite(ledA, LOW); digitalWrite(ledB, HIGH); + delay(500); - delay(500); + // Quarto periodo //digitalWrite(ledA, LOW); digitalWrite(ledB, LOW); - - delay(500); - digitalWrite(ledA, LOW); - digitalWrite(ledB, LOW); - ; } /* Domande @@ -74,3 +72,4 @@ void loop() { +