How to have 2 loops

So, I was making a small project using a LCD screen, and I ran into a problem. I wanted to have a face that would be changing at the top, with text at the bottom. But, I wanted to be able to do them in separate from the face. I was wondering if it was possible to have a second loop (or something similar to a loop) running that just controls the changing of the face. Here is my code so far.

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
lcd.begin(16, 2);
}

void loop() {
lcd.clear();
lcd.print("(^.^)");
lcd.setCursor(0, 1);
lcd.print("Hello!");
delay(2000);
lcd.clear();
lcd.print("(^.^)");
lcd.setCursor(0,1);
delay(500);
lcd.print("How are you?");
delay(10000);
}

Read BOTH the posts at the top of the forum.

Mark

I don't quite understand what you're trying to do, but yes, you can have multiple loops and/or nested loops, etc.

In fact, the two most important concepts in programming are conditional execution (if-statements, etc.) and loops (doing stuff over-and-over, usually until some condition is met).

Besides the main loop, there are [u]for-loops[/u], [u]while() loops[/u], and [u]do-while[/u] loops.

You do have to be careful about using "regular" delays in loops (or anywhere else) because program execution pauses during a delay. And for similar reasons, you have to be careful about becoming "stuck in a loop" for too long (or permanently). But, you can use multiple millis() timers as in the Blink Without Delay Example. Sometimes, I've got 2 or 3 timers running at the same time.

I think maybe that its not 2 loops you need
but just to do multiple things at the same time.

Demonstration code for several things at the same time

Multi-tasking the Arduino