Printh with Values

Hi,
im trying to send some hex values to the MCU by using:

printh AA BB CC DD EE FF

Works.

Now I want to replace one byte to a value from a variable:
printh AA BB CC DD va0.val FF

Dont work. Prints: AA BB CC DD 00 FF, anyhow whats into the var0

prints va0.val,1 works but I need it in one message.

Hi,

i am not sure if that works.
You should send the first HEX bytes by printh, send use the MCU to request the value of va0
Or better is to request everything you need from the MCU.
Thats how i do it, Nextion is “stupid” and MCU handles everything.

just put rhem in differet statements one after another.

printh AA BB CC DD
print va0.val
printh FF

It shouldn’t make any difference as they are concatenated in the serial buffer anyway.

3 Likes