void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(4, INPUT);
pinMode(5, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int Tombol = digitalRead(4);
Serial.print("nilai tombol : ");
Serial.println(Tombol);
if (Tombol == 1 ){
digitalWrite(5, HIGH);
}
else
{digitalWrite(5, LOW);}
delay(100); // this speeds up the simulation
}