Printing words repeatedly for different amounts of time

Hello, I need your help on this simple problem of mine.

I want to print words repeatedly and one by one on my LCD5110 screen, let's say word #1 is "Hello", and word #2 is "World". But I want the word "Hello" to be displayed for 1200ms, and just after that the word "World", to be replaced instead of "Hello" and displayed for 300 ms. And then this repeats, for a certain of time. I can do this with delay(), but since it blocks other stuff happening, I want to use some other way. I've tried to use millis() function, but couldn't manage to accomplish.

Thanks in advance.

Post your best attempt at solving your simple problem

check the "BlinkWithoutDelay" Example.
instead of swicht on / switch off the LED you can print "Hello" and "World"

If you need more help, post a simple sketch and describe, what's not working.

Check out my tutorial on How to write Timers and Delays in Arduino which has millis() sketches and other ways of writing various type of delays/repeats with example sketches

See Using millis() for timing. A beginners guide,

Several things at the same time

and the BlinkWithoutDelay example in the IDE

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.