1 /* Blink without Delay - only led
3 Turns on and off a light emitting diode(LED) connected to a digital
4 pin, without using the delay() function. This means that other code
5 can run at the same time without being interrupted by the LED code.
8 Schema: https://lab.piffa.net/schemi/circuito_led_bb.png
11 http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay
14 // constants won't change. Used here to
16 const int led = 13; // Primo LED
19 unsigned long previousMillis = 0; // will store last time LED was updated
20 unsigned long interval = 1000; // interval at which to blink (milliseconds)
23 // set the digital pin as output:
29 if (millis() - previousMillis >= interval) {
30 // Timestamp + timestamp = delta temporale
31 previousMillis += interval ;
33 digitalWrite(led, !digitalRead(led));