#define pin_tombol 18
#define pin_led 16
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
//Serial.println("Hello, ESP32!");
pinMode(pin_tombol, INPUT);
pinMode(pin_led, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
// this speeds up the simulation
boolean status_tombol = digitalRead(pin_tombol);
Serial.print("Status Tombol : "
Serial.print(status_tombol);
Serial.println();
if (status_tombol == 1)
{
digitalWrite(pin_led, HIGH);
}
else
{
digitalWrite(pin_led, LOW);
}
delay(100);
}