const int buttonpin = 15;
const int ledcoun = 3;
int ledPins[] = {5, 18, 19};
int CurrentLed = 0;
bool buttonState = false;
bool lastButtonState = false;
void setup() {
Serial.begin(115200);
pinMode(buttonPin, INPUT);
for (int i = 0; i < ledCount; i++) {
pinMode(ledPins[i], OUTPUT);
}
Serial.println("Hello, ESP32!");
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH && lastButtonState == LOW) {
digitalWrite(ledPins[currentLed], LOW);
currentLed = (currentLed + 1) % ledCount;
digitalWrite(ledPins[currentLed], HIGH);
// put your main code here, to run repeatedly:
delay(200); // this speeds up the simulati