what code leads up to the point where you know you need to write hex 45 ?
There may be a more elegant way but knowing how you determine that you need to send &h45 might be relevant
[quote=244702:@Norman Palardy]what code leads up to the point where you know you need to write hex 45 ?
There may be a more elegant way but knowing how you determine that you need to send &h45 might be relevant[/quote]
There’s a table of commands to send, so e.g. &h45 does one thing and &h49 does another, and some take a decimal value that has to be split in two hex bytes, so e.g. 350 (15E) must be sent as &h01 &h5E …
[quote=244730:@Shant Khatcherian]then still variable values need to go through decimalVal = val(&hXX) and then serial.write chrb(decimalVal) … not that bad anyway.
thanks![/quote]
I’d actually create a class that has each command listed that can give you back the right bytes for the command + parameters
Stuff the parameters into a memoryblock and then write the memoryblock using bytes