]> git.piffa.net Git - sketchbook_andrea/blob - basic/blinks/blink_5_2_leds/blink_5_2_leds.ino
db6fd3497d2937f326866da206ff10ed48fbe62f
[sketchbook_andrea] / basic / blinks / blink_5_2_leds / blink_5_2_leds.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 red = 12; // Definiamo un altro led
13
14 // the setup routine runs once when you press reset:
15 void setup() {                
16   // initialize the digital pin as an output.
17   pinMode(led, OUTPUT); // Abilitaiamo entrambi i LED     
18   pinMode(red, 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 }