//Grade 11D
int Bpin1 = 22;
int Bpin2 = 19;
int Bpin3 = 5;
//___________________________________
int Lpin1 = 18;
int Lpin2 = 21;
int Lpin3 = 23;
//___________________________________
int buttonState = 0;
void setup() {
// put your setup code here, to run once:
pinMode(Lpin1, OUTPUT);
pinMode(Lpin2, OUTPUT);
pinMode(Lpin3, OUTPUT);
//_____________________________
pinMode(Bpin1, INPUT_PULLUP);
pinMode(Bpin2, INPUT_PULLUP);
pinMode(Bpin3, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
//_______________________________________
if (digitalRead(Bpin1) == LOW) {
digitalWrite(Lpin1, HIGH);
}
if (digitalRead(Bpin1) == HIGH) {
digitalWrite(Lpin1, LOW);
}
if (digitalRead(Bpin2) == LOW) {
digitalWrite(Lpin2, HIGH);
}
if (digitalRead(Bpin2) == HIGH) {
digitalWrite(Lpin2, LOW);
}
if (digitalRead(Bpin3) == LOW) {
digitalWrite(Lpin3, HIGH);
}
if (digitalRead(Bpin3) == HIGH) {
digitalWrite(Lpin3, LOW);
}
}