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