Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //blog http://cursoarduinomega.blogspot.com/2015/04/boton-enciende-led.html
- int boton = 4;
- int led = 6;
- void setup() {
- pinMode(boton, INPUT);
- pinMode(led, OUTPUT);
- }
- int estado = 0;
- void loop() {
- estado = digitalRead(boton);
- if(estado == HIGH){
- digitalWrite(led, HIGH);
- }else{
- digitalWrite(led, LOW);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment