#define Ledred 12
#define Ledblue 26
#define tombol 4
bool a;
void setup() {
// put your setup code here, to run once:
pinMode(Ledred, OUTPUT);
pinMode(Ledblue, OUTPUT);
pinMode(tombol, INPUT_PULLUP);
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
if (a == LOW){
digitalWrite(Ledblue, HIGH);
digitalWrite(Ledred, LOW);
}
else if(a == HIGH){
digitalWrite(Ledred, HIGH);
digitalWrite(Ledblue, LOW);
}
a = digitalRead(tombol);
Serial.println(a);
delay(500);
}
// this speeds up the simulation