#define LED1 2
#define LED2 4
#define LED3 5
int currentLED = 0;
const int leds[] = {LED1, LED2, LED3};
int num_leds = sizeof(leds) / sizeof(leds[0]);
void setup() {
Serial.begin(115200);
Serial.println("Hello, ESP32!");
for (int i = 0; i < num_leds; i++) {
pinMode(leds[i], OUTPUT);
}
}
void loop() {
digitalWrite(leds[currentLED], HIGH); // Turn on current LED
delay(1000); // Wait for 1 second
digitalWrite(leds[currentLED], LOW); // Turn off current LED
currentLED = (currentLED + 1) % num_leds; // Move to the next LED
delay(1000); // Wait for 1 second before switching to the next LED
}