int leds[]={23,22,21,19,17,16};
void setup(){
 for(int i=0;i<=5;i++){
  pinMode(leds[i], OUTPUT);
  digitalWrite(leds[i], LOW);
 }
}

void loop(){
for(int i=0;i<=5;i++){
  digitalWrite(leds[i], HIGH);
  delay(500);
  digitalWrite(leds[i], HIGH);
  delay(500);
}
for(int i=5;i>=0;i--){
  digitalWrite(leds[i], HIGH);
  delay(500);
  digitalWrite(leds[i], HIGH);
  delay(500);
}
}