Hi,
That "clumsy formating" makes perfect sense so yes, it would be the last example. And yes, with WAIT or WAITSTR it does wait for the specified qualifier(s) and THEN start "saving". I guess, since you know what the qualifiers are, you should be able to add those bytes back in "manually" when you do the checksum?
It's all just numbers, as you know a byte can hold a value between 0 and 255. If myVAR holds the value 65 and you do HSEROUT[myVAR] to a terminal (or your serial LCD) you'll get "A" because 65 is the ASCII code for "A". But if you want the numeric value 65 to be displayed PBP needs to send two bytes, namely 54 and 53 which are the ASCII codes for "6" and "5" and this is what the DEC modifier does. There's no way for the STR modifier to know if/when you want it to send "6", "5" instead of 65.
If your had your values in an array you could, instead of a for-next loop simply done something like:
Code:
HSEROUT [#myArray[0], #myArray[1], #myArray[2]]
Don't know which are the most effective, time- or codewise but it's an alternative. Ah, you get it.
/Henrik.
Bookmarks