ARRAYWRITE to print acsi string
I just upgraded to PBP3 because I need to do a bunch of asci strings to an LCD display, and I was told you can do this with arraywrite. Well, I can't get it to work. This code just prints the first letter, how can I make it work?
Code:
myarray var byte[20]
arraywrite myarray, ["Hello World",0]
lcdout myarray
Re: ARRAYWRITE to print acsi string
Quote:
Originally Posted by
spcw1234
I just upgraded to PBP3 because I need to do a bunch of asci strings to an LCD display, and I was told you can do this with arraywrite. Well, I can't get it to work. This code just prints the first letter, how can I make it work?
Code:
myarray var byte[20]
arraywrite myarray, ["Hello World",0]
lcdout myarray
Try
For i = 0 to 19
lcdout myarray[i]
Next
Norm
Re: ARRAYWRITE to print acsi string
I will give that a try, but that will not suit my application. This is how I am trying to write to my 4D Systems display, I was hoping to minimize having to do a bajillion serout commands, and instead setup an array for the text.
Code:
myarray var byte[20]
arraywrite myarray, ["Hello World",0]
serout2 tx, baud, ["s", 0, 1, 2, white1, white2, myarray, $00]
gosub wait1 'check for ACK from display
Re: ARRAYWRITE to print acsi string
Try
Code:
LCDOUT $FE,$80, STR myarray
Re: ARRAYWRITE to print acsi string
Thanks! Exactly what I needed!
Re: ARRAYWRITE to print acsi string
Do same for SEROUT2. STR sends bytes until it reaches byte with value 0. So always keep last byte in array cleared, because pbp doesn't check boundary.
Re: ARRAYWRITE to print acsi string
Or use STR myarray\x where x is the number of bytes.
Ioannis