Blink row led without delay

I swear that I have tried for at least an hour on the forum an answer to my question. Nothing. Then we come directly to the point.
I wish I could put about twenty LEDs in a row, and turn them in sequence one after the other and then start again without the use of delay. I tried many solutions following the example of Arduino. But I just can not get it to work. I add the code below, although I know it's wrong.
I hope you can help me, thanks

int timer = 400;
int array[] = { 11, 12, 13 };

const int redPin = A0;
const int greenPin = A1;
const int bluePin = A2;

int ledState = LOW;
long previousMillis = 0;
long interval = 1000;

void setup()
{
  Serial.begin(9600);
  pinMode(array[0], OUTPUT);
  pinMode(array[1], OUTPUT);
  pinMode(array[2], OUTPUT);
}

void loop()
{ 
  Serial.print(analogRead(redPin));
  Serial.print(",");
  Serial.print(analogRead(greenPin));
  Serial.print(",");
  Serial.println(analogRead(bluePin));
  
  
  unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval) {
        // save the last time you blinked the LED 
        previousMillis = currentMillis;
        for (int x = 0; x < 3; x++){
          // if the LED is off turn it on and vice-versa:
          if (ledState == LOW)
            ledState = HIGH;
          else
            ledState = LOW;

      // set the LED with the ledState of the variable:
      digitalWrite(array[x], HIGH);
      }
    }
  }
}

This won't get the code to do what you want, but fixing this will at least make it do something. The comment here says what you want to do, the code doesn't do it:

      // set the LED with the ledState of the variable:
      digitalWrite(array[x], HIGH);

make these unsigned long:

long previousMillis = 0;
long interval = 1000;

where do you turn the LEDs off?
did you intend to do this?

digitalWrite(array[x], ledState);

I warned you that the code was not strictly correct, I have made ??many changes before posting on the forum, the initially string was like this:

digitalWrite(array[x], ledState);

But even if I put the correct string it doesn't work.
now I'm using 3 LEDs connected to pins 13, 12 and 11, and with this code, Arduino turn on the pin 13 and pin 11 at the same time, and then individually the pin 12

13,11 and then 12 - that's what your code says to do.

starting from LED=Low

x = 0
make led high
write 11 high
x = 1
make led low
write 12 low
x=2
make led high
write 13 high
wait for next interval
x=0 
make led low
write 11 low
x=1
make led high
write 12 high
x=2
make led low
write 13 low

Your logic needs work, that's all.
Make a loop within a loop
inner turns LED on/off
outer cycles thru the array

what comes to mind is to make a for, to a higher level. thus entering a pin at a time, turns on and off and then continue for.
I'm on the right path to solve it?

With the exception of resetting, there's no reason to set the state of each LED at each interval. At each interval you just want to turn on the next LED in the sequence. If all LEDs are on, then you want to turn them all off to start the sequence again. Some pseudo code:

int LEDnum = first LED
if(interval){
  if(LEDnum > last LED){
    turn off all LEDs
    reset LEDnum
  }
  else{
    turn on LEDnum
    LEDnum++ //Increment LEDnum to the next led (to be turned on at next interval)
  }

}

miraHANE:
I really love to be there.

...

miraHANE:
I love to see this. Can you share?

...

miraHANE:
I love the work you have done here.

I am missing the point of these comments.

Could be spam.

Could be spam.

Patience. It will be. The last time I think it took a week. Either the bots are trying to be smarter or the humans are getting crazier.

Try this:

#define INTERVAL 200  // how often to flash
byte pins [] = {  2, 3, 4, 5, 6, 7 };

void setup() 
{
  for (byte i = 0; i < sizeof pins; i++)
    pinMode(pins [i], OUTPUT);     
}  // end of setup

void loop ()
{
  static unsigned long previousMillis = 0;        // will store last time LED was updated
  static byte currentItem = 0;  // which array item we are at

  unsigned long currentMillis = millis();

  if (currentMillis - previousMillis > INTERVAL) 
    {
    previousMillis = currentMillis;   
    
    // toggle LED
    if (digitalRead ( pins [currentItem]) == LOW)
      digitalWrite ( pins [currentItem], HIGH);
    else
      {
      digitalWrite ( pins [currentItem++], LOW);
      currentItem %= sizeof pins;  // wrap around at end of array
      }  // end of currently on
    }  // end of it time to do something
}  // end of loop

I have been finding that the bots/people are rather cleverly echoing back parts of the posts to make it look genuine. For example:

I also find that the bots are trying to be smarter or the humans are getting crazier.

or:

Make a loop within a loop worked for me.

XD

And there's the spam (signature line).

I think the signature changed, didn't it? Anyway, I'm going to try to buy some Spam tomorrow, so we know what we are up against.

it's not spam, it's trolling.

it's not spam, it's trolling

Usually here, posts like that are precursors of spam.

Yup.

Anyway, I'm going to try to buy some Spam tomorrow, so we know what we are up against.

]:slight_smile: XD

Spam from Gammon?