#define PB1 13
const int Led1 = 15;
void setup() {
Serial.begin(115200);
pinMode(Led1, OUTPUT);
pinMode(PB1, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
char StatePB1 = digitalRead(PB1);
if (StatePB1 == LOW)
{
digitalWrite(Led1,LOW);
Serial.println("Tombol di Tekan");
delay(200);
}
if (StatePB1 == HIGH)
{
digitalWrite(Led1, HIGH);
}
delay(100); //this speeds up the simulation
}