B4R Question sending HEX-Values

newbie

Member
Licensed User
Longtime User
hi,

i need to send a string following with 3 times of 0xff to a nextion-display
I have try something like this
B4X:
astream.Write("stunde.txt=15").Write(bc.HexToBytes("FFFFFF"))
but without no success on the display.

While i have no usb to serial connector , i can't test the display with a terminal-programm.
So i don't know is my b4r-code wrong or something in the display-programming

can someone tell me what is the correct codeline

thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Your code is correct. It sends the string followed by three FF bytes.

You can optimize it and write it like:
B4X:
astream.Write("text here").Write(Array As Byte(0xFF, 0xFF, 0xFF))
Maybe you need to send a null terminated string?

Try it with:
B4X:
astream.Write("text here").Write(Array As Byte(0, 0xFF, 0xFF, 0xFF))
 
Upvote 0

newbie

Member
Licensed User
Longtime User
Your code is correct. It sends the string followed by three FF bytes.

You can optimize it and write it like:
B4X:
astream.Write("text here").Write(Array As Byte(0xFF, 0xFF, 0xFF))
Maybe you need to send a null terminated string?

Try it with:
B4X:
astream.Write("text here").Write(Array As Byte(0, 0xFF, 0xFF, 0xFF))


Thanks, i think i have found the problem: text.values must be quoted like this
astream.write("textvalue.txt="abcd"").write.......
but how can i do this ??
 
Upvote 0
Top