]> git.piffa.net Git - sketchbook_andrea/blobdiff - basic/blinks/millis/millis.ino
Motori
[sketchbook_andrea] / basic / blinks / millis / millis.ino
index d2d473dbf48d27f91e93814c3ebc380db9efbb96..90f0c43f4179a4abdff38a1ac1987eb04ccfcaa6 100644 (file)
@@ -4,30 +4,23 @@
  pin, without using the delay() function.  This means that other code
  can run at the same time without being interrupted by the LED code.
  
  pin, without using the delay() function.  This means that other code
  can run at the same time without being interrupted by the LED code.
  
 Schema: https://lab.piffa.net/schemi/circuito_led_bb.png
  
 Schema: https://lab.piffa.net/schemi/circuito_led_bb.png
  
  http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay
  */
 
  http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay
  */
 
-// constants won't change. Used here to 
-// set pin numbers:
 const int led = 13;      // Primo LED
 const int led = 13;      // Primo LED
-
               
               
-unsigned long previousMillis = 0;        // will store last time LED was updated
-unsigned long interval = 1000;           // interval at which to blink (milliseconds)
+unsigned long previousMillis = 0;        // Ultimo agiornamento
+unsigned long interval = 1000;           // Pausa tra i lampeggi
 
 void setup() {
 
 void setup() {
-  // set the digital pin as output:
   pinMode(led, OUTPUT);      
 }
 
 void loop()
 {
   if (millis() - previousMillis >= interval) {
   pinMode(led, OUTPUT);      
 }
 
 void loop()
 {
   if (millis() - previousMillis >= interval) {
-    // Timestamp + timestamp = delta temporale
     previousMillis += interval ;
 
     digitalWrite(led, !digitalRead(led));
     previousMillis += interval ;
 
     digitalWrite(led, !digitalRead(led));