How it's possible to run several loops independently at the same time?
I wrote small example for the idea what I'm looking for. In the example I would like to print a text every second and another text every five second. With this example the main loop will roll again when both loops has ran through, not like as wanted.
How do I manage to create two independent loops?
For example:
void loop(){
loop1();
loop2();
}
void loop1(){
Serial.print("text");
delay(1000);
}
void loop2(){
Serial.print("another text");
delay(5000);
}