int boton = 13;
int led = 12;
int sound = 11;
int buttonState = 0;
void setup() {
pinMode(led, OUTPUT);
pinMode(boton, INPUT);
pinMode(sound, OUTPUT);
}
void loop(){
buttonState = digitalRead(boton);
if (buttonState == HIGH) {
digitalWrite (led, HIGH);
digitalWrite (sound, HIGH);
}
else {
digitalWrite (led, LOW);
digitalWrite (sound, LOW);
}
}
Nicolas Niño
No comments:
Post a Comment