#define LED9 4
#define LED8 5
#define LED7 6
#define LED6 7
#define LED5 15
#define LED4 16
#define LED3 17
#define LED2 18
#define LED1 8

#define LAYER3 14
#define LAYER2 13
#define LAYER1 12


int ledPins[9] = {LED9, LED8, LED7, LED6, LED5, LED4, LED3, LED2, LED1};

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("Hello, ESP32-S3!");
  pinMode(LAYER3, OUTPUT);
  pinMode(LAYER2, OUTPUT);
  pinMode(LAYER1, OUTPUT);
  
  pinMode(LED9, OUTPUT);
  pinMode(LED8, OUTPUT);
  pinMode(LED7, OUTPUT);
  pinMode(LED6, OUTPUT);
  pinMode(LED5, OUTPUT);
  pinMode(LED4, OUTPUT);
  pinMode(LED3, OUTPUT);
  pinMode(LED2, OUTPUT);
  pinMode(LED1, OUTPUT);

  //Startwerte festlegen, Layer müssen LOW sein damit die LEDs überhaubt angehen
  digitalWrite(LAYER3,LOW);
  digitalWrite(LAYER2,LOW);
  digitalWrite(LAYER1,LOW);

}

void loop() {
  // Alle LEDs nacheinander an
   for( int i = 0; i <=8;i++) {
    digitalWrite(ledPins[i], HIGH);
    delay (100);
   }

   // Alle LEDS nacheinander aus
    for( int i = 0; i <=3;i++) {
    digitalWrite(ledPins[i], LOW);
    delay (50);
   }

  
  







}