Thanks, that was it.. Its amazing how I could miss it after reading through the code so many times..
One more quick question, is it possible to clear a single line of an lcd display, or atleast fill it with blank characters?
Thanks, that was it.. Its amazing how I could miss it after reading through the code so many times..
One more quick question, is it possible to clear a single line of an lcd display, or atleast fill it with blank characters?
Not efficient and code heavy but works – there must be a better way?Originally Posted by breesy
Paul BorgmeierCode:Line2Clr Var Byte X var Line2Clr 'reuse variable with alias to save RAM Line2Clr = 148 ' clear line 3 or 4x20 LCD (for example) Gosub ClrLine rest of program here ClrLine: ' subroutine LCDOUT $FE,Line2Clr,32,32 ' clear 148 and 149 with 32 (ascii blank) FOR X = 0 to 8 ' clear rest of line LCDOUT 32,32 NEXT X RETURN
Salt Lake City, Utah
USA
Last edited by paul borgmeier; - 26th June 2006 at 09:01.
We have all been there and done that in one way or anotherOriginally Posted by breesy
This is how I do it. I have a variable called "line" that I use for specifying which line of the LCD I want to go to the beginning of, and then specify CONstants for Line1, Line2 etcOne more quick question, is it possible to clear a single line of an lcd display, or atleast fill it with blank characters?
This is the sub that I use to clear the LCD (actually it fills it with spaces)
This could be extended further by changing the "16" to a variable name thereby giving the ability for a varying number of repeated characters.Code:Line var byte ' Line of Display to act on Line1 con $02 ' Home position Line2 con $C0 ' Start of Line2 ....... Line = Line2 Gosub Blankline ....... BlankLine: ' **** This clears the whole line of the display **** LCDOut $FE, Line, REP " "\16 ' Send 16 spaces to clear the line Return ' **** End of BlankLine ***
You could go the whole hog and change it to LCDout $FE, Line,REP Char\Charcount
which would allow you to specify the Line, Character and number of characters to write to the display but I guess than you would have to call it something other than "Blankline"![]()
Keith
www.diyha.co.uk
www.kat5.tv
Keith,Originally Posted by keithdoxey
Nice and clean - sweet!
Paul
Thanks Paul, but the only thing I can really take credit for is putting in a subroutine called "BlankLine". The syntax used is clearly shown on the LCDout page of the PBP manual![]()
Keith
www.diyha.co.uk
www.kat5.tv
Bookmarks