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 else { // Alterativa: se non e' +5v
27 digitalWrite(led, LOW);
32 // Funzioni create dall'utente: