int LEDMERAH = 13;
int TOMBOL = 2;
bool statustombol = 0;
void setup() {
pinMode(LEDMERAH, OUTPUT);
pinMode(TOMBOL, INPUT);
Serial.begin(115200);
}
void loop() {
statustombol = digitalRead(TOMBOL);
Serial.println(statustombol);
if (statustombol == 1) {
digitalWrite(LEDMERAH, HIGH);
}
else {
digitalWrite(LEDMERAH, LOW);
}
}