Byte question from a newbie
Hugh
Posts: 362
Hi,
This is my first post and it may expose me as being a bit of a thickie, so please bear with me - I've checked the manual and the stickies but not found the information I need, (or that I think I need...)
I am driving a serial LCD module (using LCD_Debug.spin as a starting point, but adapted for a Matrix Orbital display)
If I use:
lcd.str(string("Hello World", 13))
everything is hunky-dory.
If, however, I set up a variable 'Tes' as
DAT Tes BYTE "Hello World"
and then in MAIN
Index := 0
Repeat 8
Temp := Tes[noparse][[/noparse]Index++]
lcd.str(Temp)
a lot of gobbledeegook is displayed. My question is basically, how I can persuade it that each byte of the byte array is a String?
lcd.str(string(Temp))
doesn't compile.
As I say, I may just be being a thickie, but any help would be gratefully received.
Thanks
Hugh
This is my first post and it may expose me as being a bit of a thickie, so please bear with me - I've checked the manual and the stickies but not found the information I need, (or that I think I need...)
I am driving a serial LCD module (using LCD_Debug.spin as a starting point, but adapted for a Matrix Orbital display)
If I use:
lcd.str(string("Hello World", 13))
everything is hunky-dory.
If, however, I set up a variable 'Tes' as
DAT Tes BYTE "Hello World"
and then in MAIN
Index := 0
Repeat 8
Temp := Tes[noparse][[/noparse]Index++]
lcd.str(Temp)
a lot of gobbledeegook is displayed. My question is basically, how I can persuade it that each byte of the byte array is a String?
lcd.str(string(Temp))
doesn't compile.
As I say, I may just be being a thickie, but any help would be gratefully received.
Thanks
Hugh
Comments
What you want is lcd.out which expects a character as an argument. You'd use lcd.out(Temp)
That is, end your output string with a 0, and then pass its address using "@".