0% found this document useful (0 votes)
6 views

Arduino Contolador 3 Botones

The provided code is an Arduino sketch that sets up three output pins and one input pin. It continuously checks the state of the input pin and the output pins, turning them on or off in a sequence based on their states. The program uses delays to control the timing of the pin state changes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Arduino Contolador 3 Botones

The provided code is an Arduino sketch that sets up three output pins and one input pin. It continuously checks the state of the input pin and the output pins, turning them on or off in a sequence based on their states. The program uses delays to control the timing of the pin state changes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include<stdio.

h>

int pins[] = {8,9,10};


void setup() {
pinMode(4, INPUT_PULLUP);
for(auto x : pins){
pinMode(x, OUTPUT);

digitalWrite(x, LOW);

void loop() {

if(digitalRead(4) == LOW && digitalRead(10) == LOW && digitalRead(9) == LOW &&


digitalRead(8) == LOW){

digitalWrite(8, HIGH);

delay(150);

}
if(digitalRead(4) == LOW && digitalRead(10) == LOW && digitalRead(9) == LOW &&
digitalRead(8) == HIGH){

digitalWrite(9, HIGH);

delay(150);

}if(digitalRead(4) == LOW && digitalRead(10) == LOW && digitalRead(9) == HIGH &&


digitalRead(8) == HIGH){

digitalWrite(10, HIGH);

delay(150);

}if(digitalRead(4) == LOW && digitalRead(10) == HIGH && digitalRead(9) == HIGH &&


digitalRead(8) == HIGH){

for(auto x: pins){

digitalWrite(x, LOW);

}
delay(150);
}

You might also like