int LEDMERAH = 13;
int TOMBOL = 2;
bool statustombol = 0;
void setup() {
// put your setup code here, to run once:
pinMode (LEDMERAH,OUTPUT);
pinMode (TOMBOL,INPUT);
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
statustombol = digitalRead(TOMBOL);
Serial.println(statustombol);
if (statustombol == 1){
digitalWrite(LEDMERAH,HIGH);
}
else{
digitalWrite(LEDMERAH,LOW);
}
}