2 Debug con macro per il preprocessore
6 Accensione e spegnimanto di un LED utilizzando variabili
7 per impostare la velocita' del lampeggio.
9 Turns on an LED on for one second, then off for one second, repeatedly.
11 This example code is in the public domain.
14 // Pin 13 has an LED connected on most Arduino boards.
17 int breve = 200; // Variabile richiambile nel corso dell'esecuzione
22 #define DEBUG_PRINT(x) Serial.print (x)
23 #define DEBUG_PRINTDEC(x) Serial.print (x, DEC)
24 #define DEBUG_PRINTLN(x) Serial.println (x)
26 /* A volte il codice di debug e' complicato e deve sostituire parte del codice
27 notmalmente usato. In questo modo potete specificare parte di codice
28 da eseguire in modalita' non-debug differente da quello di debug */
29 #define DEBUG_PRINT(x)
30 #define DEBUG_PRINTDEC(x)
31 #define DEBUG_PRINTLN(x)
34 // the setup routine runs once when you press reset:
36 // initialize the digital pin as an output.
41 // the loop routine runs over and over again forever:
43 digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
44 DEBUG_PRINTLN("Stato HIGHT");
45 delay(breve); // wait for a second
46 digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
47 DEBUG_PRINTLN("Stato LOW");
48 delay(breve); // wait for a second