ARDUINO MEGA 2560 ARDUINO MEGA 2560 J.L.G.C | Page 13

int leds=2;

int pulsador=1;

void setup() {

pinMode(pulsador, INPUT);

pinMode(leds, OUTPUT);

}

void loop()

{

if(digitalRead(pulsador)==HIGH)

{

digitalWrite(leds, HIGH);

}

else

{

digitalWrite(leds, LOW);

}

}

programacion

10