One of two LCD problems
Guido
Posts: 195
As usual I am stumped. I am trying to display a result from a lookup expression. Basically just trying to display a Letter. I have two examples here. Example 1 I have converted the letter· to see if I could Display· it using an ASCII and not converting it. Example 2 , is just using the Letter then convert it to an ASCII. Either way I can not get it to display properly. Any help would be greatly appreciated.
Thank You
Guido
EXAMPLE 1
LOOKUP M,[noparse][[/noparse]"78","78 ","83","83","83","69","69 "],A······················· ' Lookup First compass indicator A
ADDR=A
ADDR=ADDR
char =addr
GOSUB LCDcommand
char = DDRam + 14············································································· ' show address at position 14
GOSUB LCDcommand
temp = addr
width = 1
GOSUB lcdwrite·················································································· ‘RESULTS =ASCII just write it
EXAMPLE· 2
LOOKUP M,[noparse][[/noparse]"N","N ","S","S","S","E","N "],A·································· ' Lookup First compass indicator A
ADDR=A
ADDR=ADDR
char =addr
GOSUB LCDcommand
char = DDRam + 14·············································································· ' show address at position 14
GOSUB LCDcommand
temp = addr
width = 1
GOSUB putval······················································································ ‘ Go convert to ASCII then write
············
Thank You
Guido
EXAMPLE 1
LOOKUP M,[noparse][[/noparse]"78","78 ","83","83","83","69","69 "],A······················· ' Lookup First compass indicator A
ADDR=A
ADDR=ADDR
char =addr
GOSUB LCDcommand
char = DDRam + 14············································································· ' show address at position 14
GOSUB LCDcommand
temp = addr
width = 1
GOSUB lcdwrite·················································································· ‘RESULTS =ASCII just write it
EXAMPLE· 2
LOOKUP M,[noparse][[/noparse]"N","N ","S","S","S","E","N "],A·································· ' Lookup First compass indicator A
ADDR=A
ADDR=ADDR
char =addr
GOSUB LCDcommand
char = DDRam + 14·············································································· ' show address at position 14
GOSUB LCDcommand
temp = addr
width = 1
GOSUB putval······················································································ ‘ Go convert to ASCII then write
············
Comments
char = DDRam + 14
GOSUB LCDcommand
LOOKUP (direction / 45), [noparse][[/noparse]"NSSEEWWN"], char
GOSUB LCDwrite
This example assums that direction has a value of 0 - 359.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
You are a Great! Dam been pulling my hair out along time on that one. Sure feel stupid after you show the problem…Well guess I am! It works great now, and I am learning….The last problem I have with this is trying to display the Compass Degrees. It seems that the readings,·I get goes from 0-about 250 or so before it goes crazy. Sounds like a byte thing, but as you can see I have identified all aspects of it to a word value? Any good ideas?
Thanks Again for your Help..
AZIMUTH·············· VAR··· WORD
RESULT·················· VAR··· WORD
AZIMUTH = RESULT */360
ADDR=AZIMUTH
char = addr
GOSUB LCDcommand
char = DDRam + 13 + LINE2
GOSUB LCDcommand
temp = addr
width = 3
GOSUB PUTVAL
http://forums.parallax.com/showthread.php?p=519247
I attached a program that will print a right-justified number to an LCD -- it should be helpful.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Thank you for your help, I did find the problem. Its seems I had the addr variable as a byte...changed to Word and worked great. Thanks Again