The blinking LEDs wont run in Sequence 3 codes

Thank you all I need about a week to study all, thanks for your patience

Hi UKHeliBob, I tried that but the LEDs are not blinking one by one, What I am trying to do is #1 LED on, then OFF, then #2 LED on, then OFF abd so on for the 12 LEDS and start again. I added a few comments to your code , I woud appreciate any explanation of some parts I commented on.

[code]

/*
LEDs blinks in two's no clear sequence one after another
from forum UKHeliBob looks very good, I understand the LOW / HIGH changes
*/
const byte ledPins[] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };  // got 12 LEDs working 
const byte LED_COUNT = sizeof(ledPins) / sizeof(ledPins[0]);    //calculate number of LEDs
const int PERIOD = 1000;                   //LED period in milliseconds
byte currentLed = 0;

void setup()
{
    for (int p = 0; p < LED_COUNT; p++)// what's the  p = 0 doing ?? 
    {   //AN explanation of the above line would be appreciated
        //like whats the int p = 0;  and p < LED_COUNT; p++ 
        pinMode(ledPins[p], OUTPUT);
        digitalWrite(ledPins[p], HIGH);          //start with LEDs off
        digitalWrite(ledPins[currentLed], LOW);  //turn on first LED
    }
}

void loop()
{
    Serial.println(currentLed);
    delay(PERIOD);
    digitalWrite(ledPins[currentLed], HIGH);  //turn off current LED
    currentLed += 1;           //move to next LED
    if (currentLed >= LED_COUNT)              //wrap around to first LED
    {
        currentLed = 0;
    }
    digitalWrite(ledPins[currentLed], LOW);  //turn on next LED
}
[/code]

Hi gcjr, thanks for your help. The code is not working, What I am trying to do is #1 LED on x tims then OFF then #2 LED on, then OFF and so on for the 12 LEDs and start again.
what is this line doing..... int idx = NminLeds-1;
For example what is ...........msecList

I have just read my post again and seen an error in my explanation. I said in my NOTE

what I meant to say was

This was written for a system where LOW turns the LEDs on and HIGH turns them off

Sorry for the confusion

The code works perfectly for me, noting the proviso above

This is the start of a for loop that will read the array of LED pin numbers one by one. We start at zero because that is the first index to the array and continue until we have done all of the LED pin numbers in the array, ie we have reached the value of LED_COUNT

Did you change the following lines in setup() ?

        digitalWrite(ledPins[p], HIGH);          //start with LEDs off
        digitalWrite(ledPins[currentLed], LOW);  //turn on first LED

Actually, the second one should really be outside of the for loop but it it does not really matter

i believe the code doing what you ask. it sequentially turns each of 12 LEDs on for 5mins at a time. the code is written for active LOW LEDs. if you see all but one LED on, reverse the definitions for OFF/ON
enum { Off = LOW, On = HIGH };

this initializes the variable idx to the # of LEDs minus 1. for 12 LEDs, it initialize the index to 11, which is the last LED (starting from 0)

Thanks Bob that works brilliantly, when I changed the HIGH and LOW. I very much appreciate your inputs,
I have Arduino working on 5 different areas, the solar pump controller, 2 actuator vents in 2 greenhouses and the solar pump controller.There ia a great irony in all this, in my post #15 above from ChatGPT also works. I have been trying to get away form DELAY
Thank you all this a great forum