int btn_pullUP = 25;
int value_pullUP = 0;
int btn_pullDOWN = 22;
int value_pullDOWN = 1;
int ledPin = 33;
int ledPin2 = 12;
int ledPin3 = 14;
int ledPin4 = 27;
int ledPin5 = 26;
void setup() {
pinMode(btn_pullUP,INPUT);
pinMode(btn_pullDOWN,INPUT);
pinMode(ledPin,OUTPUT);
pinMode(ledPin2,OUTPUT);
pinMode(ledPin3,OUTPUT);
pinMode(ledPin4,OUTPUT);
pinMode(ledPin5,OUTPUT);
Serial.begin(115200);
}
void loop(){
value_pullUP = digitalRead(btn_pullUP);
value_pullDOWN = digitalRead(btn_pullDOWN);
Serial.println(value_pullUP);
Serial.println(value_pullDOWN);
if(value_pullUP == 0){
digitalWrite(ledPin, HIGH);
delay(200);
digitalWrite(ledPin2, HIGH);
delay(200);
digitalWrite(ledPin3, HIGH);
delay(200);
digitalWrite(ledPin4, HIGH);
delay(200);
digitalWrite(ledPin5, HIGH);
delay(200);
}
else if(value_pullUP == 1){
digitalWrite(ledPin, LOW);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, LOW);
digitalWrite(ledPin4, LOW);
digitalWrite(ledPin5, LOW);
}
if(value_pullDOWN == 1){
digitalWrite(ledPin5, HIGH);
delay(200);
digitalWrite(ledPin4, HIGH);
delay(200);
digitalWrite(ledPin3, HIGH);
delay(200);
digitalWrite(ledPin2, HIGH);
delay(200);
digitalWrite(ledPin, HIGH);
delay(200);
}
else if(value_pullDOWN == 0){
digitalWrite(ledPin5, LOW);
digitalWrite(ledPin4, LOW);
digitalWrite(ledPin3, LOW);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin, LOW);
}
}