4 Accensione e spegnimanto di un LED utilizzando un pin come input.
9 // Pin 13 has an LED connected on most Arduino boards.
14 // the setup routine runs once when you press reset:
16 // initialize the digital pin as an output.
17 pinMode(led, OUTPUT); // Il PIN e' attivato come output
18 pinMode(input, INPUT); // Il PIN e' attivato come output
21 // the loop routine runs over and over again forever:
23 if (digitalRead(input) == HIGH) { // Verifica se il PIN input e' +5V
24 digitalWrite(led, HIGH);
26 if (digitalRead(input) == LOW) { // Verifica se il PIN input e' 0V
27 digitalWrite(led, LOW);
32 // 1. invertire il programma facendo in modo che il led si spenga
33 // quando il bottone e' premuto. Consoderare come ottenere lo stesso risultato
34 // modificando il circuito.
35 // 2. Modificare il programma per far brillare il led cinque volte al secondo
36 // quando il bottone e' premuto.
38 // Domanda: cosa succede se il jumper input non e' collegato ne al +5 ne al gound?