void setup() {
pinMode(2, INPUT_PULLUP);// define pin two as input for push button
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, OUTPUT);// defind pin 5 as output
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
}
void loop()
{
int pusshed = digitalRead(2);// read pin 2 and put the result in the "pusshed" variable
if(pusshed == LOW)
{
digitalWrite(5, HIGH);// if pusheed is equal LOW, turn the pin 10 HIGH (give it 5v)
}
else{
digitalWrite(5, LOW);// else set pin 10 to low or zero volt
}
int pusshed1 = digitalRead(3);// read pin 2 and put the result in the "pusshed" variable
if(pusshed1 == LOW)
{
digitalWrite(6, HIGH);// if pusheed is equal LOW, turn the pin 10 HIGH (give it 5v)
}
else{
digitalWrite(6, LOW);// else set pin 10 to low or zero volt
}
int pusshed2 = digitalRead(4);// read pin 2 and put the result in the "pusshed" variable
if(pusshed2 == LOW)
{
digitalWrite(7, HIGH);// if pusheed is equal LOW, turn the pin 10 HIGH (give it 5v)
}
else{
digitalWrite(7, LOW);// else set pin 10 to low or zero volt
}
}