//ESP32 BLINKING LEDS int LEDS[10]={15,2,16,17,5,18,19,21,22,23}; // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. for(int i=0;i<10;i++) { pinMode(LEDS[i],OUTPUT);} pinMode(34,INPUT); } // the loop function runs over and over again forever void loop() { if (digitalRead(34)==0) { for(int i=0;i<10;i++) {digitalWrite(LEDS[i], HIGH); // turn the LED on (HIGH is the voltage level) delay(10); // wait for a 0.05 second digitalWrite(LEDS[i], LOW); // turn the LED off by making the voltage LOW delay(10);} // wait for a 0.05 second } else { for(int i=9;i>=0;i--) {digitalWrite(LEDS[i], HIGH); // turn the LED on (HIGH is the voltage level) delay(10); // wait for a 0.05 second digitalWrite(LEDS[i], LOW); // turn the LED off by making the voltage LOW delay(10);} // wait for a 0.05 second } }