const int LED1 = 2;
const int LED2 = 4;
const int S1 = 13;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(S1, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(S1)== LOW)
digitalWrite(LED2, HIGH);
else
digitalWrite(LED2, LOW);
digitalWrite(LED1, HIGH);
delay(500); // this speeds up the simulation
digitalWrite(LED1, LOW);
delay(500);
}