]> git.piffa.net Git - sketchbook_andrea/blob - oggi/blink_0/blink_0.ino
96f69215038c3e9abc763349a967bf93181cd109
[sketchbook_andrea] / oggi / blink_0 / blink_0.ino
1 /*
2   Blink
3  Turns on an LED on for one second, then off for one second, repeatedly.
4  
5  This example code is in the public domain.
6  */
7
8 // Pin 13 has an LED connected on most Arduino boards.
9 // give it a name:
10 int led = 13;
11
12 // the setup routine runs once when you press reset:
13 void setup() {                
14   // initialize the digital pin as an output.
15   pinMode(led, OUTPUT);     
16 }
17
18 // the loop routine runs over and over again forever:
19 void loop() {
20   digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
21   delay(1000);               // wait for a second
22   digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
23   delay(1000);               // wait for a second
24 }
25
26 /* Domande
27  1. Aggiungere un secondo LED e farlo brillare ogni 500ms
28  mentre il primo brilla ogni 1000ms
29  2. Cosa succederebbe se dovessi anche leggere un input da un sensore / bottone?
30  */
31