]> git.piffa.net Git - sketchbook_andrea/blob - basic/blinks/blink_1_variabili/blink_1_variabili.ino
Numerati bliks
[sketchbook_andrea] / basic / blinks / blink_1_variabili / blink_1_variabili.ino
1 /*
2   Blink v1
3
4   Accensione e spegnimanto di un LED utilizzando variabili
5   per impostare la velocita' del lampeggio.
6   
7   Turns on an LED on for one second, then off for one second, repeatedly.
8  
9   This example code is in the public domain.
10  */
11  
12 // Pin 13 has an LED connected on most Arduino boards.
13 // give it a name:
14 int led = 13;
15 int breve = 200;  // Variabile richiambile nel corso dell'esecuzione
16 int lunga = 1000;
17
18 // the setup routine runs once when you press reset:
19 void setup() {                
20   // initialize the digital pin as an output.
21   pinMode(led, OUTPUT);     
22 }
23
24 // the loop routine runs over and over again forever:
25 void loop() {
26   digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
27   delay(breve);               // wait for a second
28   digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
29   delay(breve);               // wait for a second
30
31   digitalWrite(red, HIGH);   // turn the LED on (HIGH is the voltage level)
32   delay(lunga);               // wait for a second
33   digitalWrite(red, LOW);    // turn the LED off by making the voltage LOW
34   delay(lunga); 
35 }