// the code in setup function runs only one time when ESP32 starts
void setup() {
// initialize digital pin GIOP18 as an output.
pinMode(18, OUTPUT);
}
// the code in loop function is executed repeatedly infinitely
void loop() {
digitalWrite(18, HIGH); // turn the LED on
delay(500); // wait for 500 milliseconds
digitalWrite(18, LOW); // turn the LED off
delay(500); // wait for 500 milliseconds
}