void setup() {
// put your setup code here, to run once:
pinMode(2, INPUT); // declaro pin 2 como entrada)
pinMode(3, OUTPUT); // declaro pin 3 como salida
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(2)==HIGH) // evaluo si input == H o == L
digitalWrite(3, HIGH); //enciendo led
else{
digitalWrite(3, LOW); // apago led
}
}