how to make the second line of lcd blink?

thatoneguy

Joined Feb 19, 2009
6,359
Writing the message out, waiting half a second, writing out a blank line, wait a half second, etc.

The update should be done with a timer interrupt rather than a delay() function so inputs aren't ignored during the flashing period.
 

Thread Starter

edski

Joined Sep 22, 2010
65
can you help me how could i be able to do that? i mean, can you please show some example code. pls. thanks
 

spinnaker

Joined Oct 29, 2009
7,830
yes i have the diagram. im using C..yes i can write without blinking..

If you can do that then you are most of the way there. The simple way is to create a loop. First write out your line, delay a bit, then write out a blank line, delay a bit then start the loop all over again.

The delay does not need to be any thing fancy. It can be a for loop.


The right way to do it is to setup a timer. The text you write to the lcd would be written to a string variable instead. The timer interrupt routine would have a flag called bWriteBlank. It would be set to false by default. If false the timer interrupt writes the string to the LCD if true it writes a blank line.

Give it a try yourself first. If you get stuck I will see what I can do about writing the code for you. But you should try yourself first.

Try the first suggestion I had first then you can move on to the more complicated timer interrupt.
 

spinnaker

Joined Oct 29, 2009
7,830
I went ahead and wrote something fo you. But you should really try yourself first.

The first sample is a simple loop with a delay. The second sample uses a timer interrupt.

Both samples are based on a PIC18f45k22 with a 1MHZ clock. You may need to make some adjustments to your code to fit your PIC, clock and pinouts.
 
Top