Cycle between LED functions, IE: flashing, dimming, and pulsing

Hello, I am starting a new project. I plan to make a K2SO droid head from StarWars. I want the eyes to move and flash to act like it real and broken in a way. Right now I am trying to figure out how to write my code. So far I have it where once when I turn it on the led flashes a bit and then stays on like it starts up/wakes up. from there I want the LED to flash fast, pulse, dim down and back up, and maybe a couple of other variations of these randomly. I'm not sure how I want to go about this. I just need to be able to code these patterns and then have a loop where it chooses between these patterns randomly. This is what I have so far It's not pretty but it works for the wake-up part of this project.
I am pretty new to coding but am determined so leading me to different forums will help a ton or if you could explain your reasoning would be amazing.
-Vlassov

const byte ledPin = 2;
byte flashCount = 0;
byte state = 0;
unsigned long waitStart;
unsigned long shortPeriod = 45;
unsigned long longPeriod = 5000;
unsigned long currentTime;



void setup() {
  Serial.begin(115200);
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, LOW);
  waitStart = millis();
}





void loop() {
  switch (state) {
    case 0:
      currentTime = millis();
      if (currentTime - waitStart >= shortPeriod) {
        digitalWrite(ledPin, !digitalRead(ledPin));
        waitStart = currentTime;
        flashCount++;
        if (flashCount == 6) {
          state = 1;
        }
      }
      break;

    case 1:
      currentTime = millis();
      if (currentTime - waitStart >= longPeriod) {
        waitStart = currentTime;
        flashCount = 0;
        state = 1;
      }
      break;
  }
}

Hello

Maybe try this library GitHub - Yveaux/LedPattern: Arduino library to run set-and-forget LED blink patterns

Is there a way to actually get the library? This is exactly what I need but I cant find the download for the library.

something like this?

note that for dimming up/down, you should probably using one of the PWM pins on your board.

Hope that helps...

Download .zip from github then in Arduino IDE do Sketch > Include library > Add .ZIP library

do you know where the .zip file is in the github?

In the link I posted, click the Code button then Download .zip

Thank you!!!