- Quali variabili determinano il comportamento del LED?
- Come cambiano durante il corso dello script?
- Sono globali o locali?
- Quali variabili determinano il comportamento del LED?
- Come cambiano durante il corso dello script?
- Sono globali o locali?
-int ledStateA = LOW; // ledState used to set the LED
-long previousMillisA = 0; // will store last time LED was updated
+int ledStateA = LOW; // ledState used to set the LED
+long previousMillisA = 0; // will store last time LED was updated
// the follow variables is a long because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
// the follow variables is a long because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
void lightLedA () ;
//////////////
// Second LED
// Now with less global variables thanks to static (see function body)
const int ledB = 12; //Secondo LED
void lightLedA () ;
//////////////
// Second LED
// Now with less global variables thanks to static (see function body)
const int ledB = 12; //Secondo LED
- // ledState used to set the LED
-long previousMillisB = 0; // will store last time LED was updated
- // interval at which to blink (milliseconds)
+ // ledState used to set the LED
+long previousMillisB = 0; // will store last time LED was updated
+ // interval at which to blink (milliseconds)
// set the LED with the ledState of the variable:
digitalWrite(ledA, ledStateA);
}
// set the LED with the ledState of the variable:
digitalWrite(ledA, ledStateA);
}
// set the LED with the ledState of the variable:
digitalWrite(ledB, ledStateB);
}
// set the LED with the ledState of the variable:
digitalWrite(ledB, ledStateB);
}