int ledb=11;
int ledg=9;
int ledy=7;
int ledr=5;
int ledw=3;
int button1=13;
int button2=0;
void setup() {
pinMode(ledb, OUTPUT);
pinMode(ledg, OUTPUT);
pinMode(ledy, OUTPUT);
pinMode(ledr, OUTPUT);
pinMode(ledw, OUTPUT);
pinMode(button1, INPUT);
pinMode(button2, INPUT);
}
void loop() {
if (digitalRead(button1)==LOW) {
digitalWrite(ledb, HIGH);
digitalWrite(ledg, HIGH);
digitalWrite(ledy, HIGH);
digitalWrite(ledr, HIGH);
digitalWrite(ledw, HIGH);
}
if (digitalRead(button2)== LOW) {
digitalWrite(ledb, LOW);
digitalWrite(ledg, LOW);
digitalWrite(ledy, LOW);
digitalWrite(ledr, LOW);
digitalWrite(ledw, LOW);
}
}
Comments