]> git.piffa.net Git - sketchbook_andrea/blob - serial/debug_1_preprocessor_simple/debug_1_preprocessor_simple.ino
multitasking
[sketchbook_andrea] / serial / debug_1_preprocessor_simple / debug_1_preprocessor_simple.ino
1 /*
2   Debug con macro per il preprocessore
3  
4  Blink v1
5  
6  Accensione e spegnimanto di un LED utilizzando variabili
7  per impostare la velocita' del lampeggio.
8  
9  Turns on an LED on for one second, then off for one second, repeatedly.
10  
11  This example code is in the public domain.
12  */
13
14 // Pin 13 has an LED connected on most Arduino boards.
15 // give it a name:
16 int led = 13;
17 int breve = 200;  // Variabile richiambile nel corso dell'esecuzione
18
19 #define DEBUG
20
21
22 // the setup routine runs once when you press reset:
23 void setup() {                
24   // initialize the digital pin as an output.
25   pinMode(led, OUTPUT);     
26   Serial.begin(9600);
27 }
28
29 // the loop routine runs over and over again forever:
30 void loop() {
31   digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
32 #ifdef DEBUG
33   Serial.println("High");
34 #endif 
35
36   delay(breve);               // wait for a second
37   digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
38 #ifdef DEBUG
39   Serial.println("Low");
40 #endif 
41   delay(breve);               // wait for a second
42 }
43
44
45
46