int LED1 = 23; //Active Low
int Pb1 = 34; //Pull Down
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Tugas No.2, Muhammad Luthfi Adri_ 2102331017_ AB-5K");
pinMode(LED1, OUTPUT);
pinMode(Pb1, INPUT_PULLDOWN);
}
void loop() {
// put your main code here, to run repeatedly:
pb_led(Pb1, LED1);
}
void pb_led(int ch_in, int ch_out){
if(digitalRead(ch_in) == HIGH){
digitalWrite(ch_out, LOW);
}else if(digitalRead(ch_in) == LOW){
digitalWrite(ch_out, HIGH);
}
}