Many instances of same function but different arguments..

Possibly this will be a breeze for the C Gurus !!

In the code below what change do I have to make so that I can flash the three LEDs at different rates ? Right now only the first call is active for the other two LEDs ( 2 and 3 ) ...

void setup()
{
 Serial.begin(9600);
 Serial.println("Blink code starts..."); 
}

void loop()
{
  ledPrgOnOff(1000, 500, 13);       
  ledPrgOnOff(2000, 100, 2);
  ledPrgOnOff(500, 500, 3);
}

//$$$$$$$$$$$$$$$$$$$$$

// Function to blink an LED based on programmed On Times and Off times..

void ledPrgOnOff(long onPeriod, long offPeriod, byte ledPin )
{
  unsigned long currentMillis = millis();
  static unsigned long previousMillis = millis();
  static boolean ledState;
  static boolean onLED = 1;
  static boolean offLED = 0;
  
  if ( onLED )
  {
    if (currentMillis - previousMillis >= onPeriod)
    {
      ledState = LOW;
      onLED = 0;
      offLED = 1;
      previousMillis = currentMillis;
    }
  }
  if ( offLED )
  {
    if (currentMillis - previousMillis >= offPeriod)
    {
      ledState = HIGH;
      onLED = 1;
      offLED = 0;
      previousMillis = currentMillis;
    }
  }
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, ledState);     // Update the LED state
}

You only have one variable for onLED, offLED, ledState and previousMillis but they will be different for each LED. I note also that there are no pinMode()s set

Try this

unsigned long startTimes[] = {0, 0};
unsigned long periods[] = {1001, 1005};    //examples
const byte ledPins[] = {3, 5};
const int numberOfLeds = sizeof(ledPins) / sizeof(ledPins[0]);

void setup()
{
  Serial.begin(115200);
  Serial.print("Number of LEDs : ");
  Serial.println(numberOfLeds);
  for (int pin = 0; pin < numberOfLeds; pin++)
  {
    pinMode(ledPins[pin], OUTPUT);
  }
}

void loop()
{
  unsigned long currentTime = millis();
  for (int led = 0; led < numberOfLeds; led++)
  {
    if (currentTime - startTimes[led] > periods[led])
    {
      digitalWrite(ledPins[led], !digitalRead(ledPins[led]));
      startTimes[led] = startTimes[led] + periods[led];
    }
  }
}

Change the LED pin numbers and the number of them but don’t forget to update the number of periods and start times as well