Menu

Blinking string on LCD ?

Help
2015-01-22
2015-01-24
  • Jacques Nilo

    Jacques Nilo - 2015-01-22

    Hello all
    I am trying to have one word blinking on one line of a 2x16 LCD using GCB. The rest of the sreen should not change and I want to avoid an infinite loop to do that.

    The structure of the program would be something like:

    dim msg as string
    msg="world"
    cls
    locate 0,0
    print "First line to remain unchanged"
    locate 1,0
    print "Hello "
    locate 1,8
    print msg

    I would like to have msg blinking :-)
    Thanks to all the GCB LCD specialists for their suggestions !

     
  • gcha44

    gcha44 - 2015-01-22

    Hello,
    you can write :

    cls
    print "line 1 unchanged" 'only 16 caracters
    locate 1,0
    print "Hello "
    do
    locate 1,8
    print "world"
    wait 1 s
    locate 1,8
    LCDspace 6
    wait 1 s
    loop

     
  • Jacques Nilo

    Jacques Nilo - 2015-01-22

    Thanks
    Yes I was aware of that kind of approach but I am trying to avoid the do ... loop structure
    Any other suggestion ?

     
  • kent_twt4

    kent_twt4 - 2015-01-22

    Use a Timer1 interrupt. Choose a prescale value and preloaded Timer1 register value to the desired time on/off. Then toggle the word value in the Call function using a counter value and a "If..Else..Endif". That should use the least amount of overhead.

     
  • Jacques Nilo

    Jacques Nilo - 2015-01-22

    That cannot work in my project the timer1 interrupt being already used to synchronize an adread sampling :-( hence my attempt to find another route

     
  • kent_twt4

    kent_twt4 - 2015-01-22

    More information needed then, device?, how critical is the a-d timing?, a whole host of questions.

    Otherwise, the counter could be used inside the a-d interrupt, if it is a time dependent trigger? Shorten/lengthen the timeout to make it work? Or just use a counter/interrupt off of TMR0 overflows, and just poll/reset the counter in main.

     
  • Jacques Nilo

    Jacques Nilo - 2015-01-24

    You are right I think I have to rethink about the way my program is designed. I was hopping that some kind of control code sequence was available to activate blinking of a character on the HD44780 as it is the case for the cursor through the LCDCmd command. But apparently HD44780 does no support that.
    Thanks for your input !

     

Log in to post a comment.