- Arduino partiamo da zero - n°2
Post precedente - n° 1
Proviamo ad usare un pulsante.
Ora vediamo lo sketch
Con il circuito realizzato nel post precedente abbiamo a disposizione un pulsante ed un Led.
Nell'IDE troverete nella cartella esempi lo sketch "Button"
/*
Button
Turns on and off a light emitting diode(LED) connected to digital
pin 13, when pressing a pushbutton attached to pin 2.
The circuit:
* LED attached from pin 13 to ground
* pushbutton attached to pin 2 from +5V
* 10K resistor attached to pin 2 from ground
Button
Turns on and off a light emitting diode(LED) connected to digital
pin 13, when pressing a pushbutton attached to pin 2.
The circuit:
* LED attached from pin 13 to ground
* pushbutton attached to pin 2 from +5V
* 10K resistor attached to pin 2 from ground
Potete utilizzare il circuito realizzato cambiando nello sketch il pin 2 con il pin 6.
