Writing a message and blinking LED for one minute in for loop

Is it possible to make a for loop where in every cycle an element from array would be printed on serial monitor and an LED would stay HIGH for a minute without delay()? Pseudo code:

void loop () 
{
     for (i = 0; i < NUMBR; i++) 
     {
          Serial.print(array[i]);
          turn "ON" an LED and hold it "ON" for 1 minute  for this element of array,
          without writing delay(1000) in the following line, and 
          digitalWrite(LED, LOW) in  the line after that          
     }
}

So lets say in array I have numbers 4,5,6. On serial monitor should be printed number 4 and at the same time LED should go "ON". On monitor number 4 should stay printed 1 minute before the next number is printed and LED should stay "ON" for 1 minute and continue like so for each number/element in array.

Yes.
Use the principle shown in the BlinkWithoutDelay example in the IDE.

So when does the LED actually go off - after all the elements of the array are printed?

Sorry, forgot to say that also. It should go "OFF" after that one minute. So in short: number should stay printed for 1 minute and LED should stay "ON" for 1 minute, after that 1 minute LED should go "OFF" and the next number should be printed and LED should go "ON" again.

Sounds like the led will be on for the whole loop through the numbers - as soon as you turn it off, the sketch will loop round and turn it on again. It won't be visible until the very end assuming the led goes off for good. As you have it now of course it will just run loop over & over and the led will be on forever.

If possible, the transition should be visible. So: printed number and LED stay "ON" 1 minute, they turn "OFF", transition which is visible (a couple of seconds), next element printed and LED stay "ON" for 1 minute. All that if possible without a single delay() in a for loop.

All that if possible without a single delay() in a for loop.

As you are insisting that there be no use of delay() I assume that something else is going on that must not be blocked. What else is going on ?

Just an aside question. Does really everything, during the delay(), stops? Including the timers, timer interrupts and ISRs ?

It doesn't really matter what else is going on. The parts that happen take very little time once the time detection has occurred.
Look "20Hz" in the forum, I posted some code there that will similar to what you are trying to do - start something that runs continuously (your array reading & printing) and then a second action (your LED off time).
It's all a variation on blink without delay, some may say state-machine like.

CrossRoads:
It doesn't really matter what else is going on. The parts that happen take very little time once the time detection has occurred.
Look "20Hz" in the forum, I posted some code there that will similar to what you are trying to do - start something that runs continuously (your array reading & printing) and then a second action (your LED off time).
It's all a variation on blink without delay, some may say state-machine like.

Acutely, I am building some kind of state-machine

orry, forgot to say that also. It should go "OFF" after that one minute. So in short: number should stay printed for 1 minute and LED should stay "ON" for 1 minute, after that 1 minute LED should go "OFF" and the next number should be printed and LED should go "ON" again.

Be careful what you ask for.

const int ledPin =  13;      
int ledState = LOW;

unsigned long previousMillis = 0;
unsigned long currentMillis = 0;
long interval = 60UL * 1000UL;
int pos = 0;
int myarray[] = {5, 6, 7};

void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(115200);
}

void loop(){
  currentMillis = millis();
 
  if(currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;
    digitalWrite(ledPin, LOW);
    Serial.println(myarray[pos]);
    pos = (pos + 1) % 3;
  }
  digitalWrite(ledPin, HIGH);
}

Don't blame me if it looks like the led is ON all the time :fearful:

-Fletcher

Should maybe this work:

void loop () 
{
                for (i = 0; i < NMBR; i++) 
                {
                           savedTime = millis;     
                           digitalWrite (LED, HIGH);   
                           Serial.print(array[i]);
                           while (((time = millis()) - savedTime) < 61000)  {}

                            digitalWrite (LED, LOW);
                            savedTime = millis();
                           while (((time = millis()) - savedTime) < 5000)  {}                                                                                                    
                }
}
while (((time = millis()) - savedTime) < 61000)  {}

If it works that code waits in the while loop until the condition is met. You might as well use delay()

#include "Timer.h"

Timer t;
int pin = 13;

void setup()
{
  pinMode(pin, OUTPUT);
  t.pulse(pin, 10 * 1000, HIGH); // 10 seconds
  // t.pulse(pin, 10 * 60 * 1000, HIGH); // 10 minutes
}

void loop()
{
  t.update();
}

This code might solve ur issue