int led_pins[8]={19,18,5,17,16,4,0,2};
int on_button=12;
int off_button=14;
bool run=false;
int count=0;
void setup(){
{
// put your setup code here,to run once:
Serial.begin(115200);
Serial.println("Hello,ESP32!");
pinMode(on-button, INPUT_PULLUP);
pinMode(off_button, INPUT_PULLUP);
}
for(int i=0;i<8;i++){
pinMode(led_pins,[i],OUTPUT);
}
}
void loop(){
if(digitalRead(on_button)==0){
run=true;
}
if(digitalRead(off_button)==0){
run=false;
all_off();
}
// running led
if(run==true){
all_off();
digitalWrite(led_pins[count++], HIGH);
delay(1000);
if(count>=8){
count=0;
}
}
}