PropBasic: SEROUT byte array (sanity check)
VonSzarvas
Posts: 3,622
To output a set of byte codes with serout, should this work ?
Thank you.
CONFIGLCD DATA $F0,$F0,$07,$00,$08,$00,$A6,CR,LF SEROUT TXPIN, BAUD, CONFIGLCD
Thank you.

Comments
So I suspect my question should be, how to actually SEROUT a DATA label containing $00 ?
And to transmit the data label:
Here is the new sub I added to the serial lib:
'{$IFUSED TX_DATA} SUB TX_DATA __param3 = __param1 ' Save param as __param1 overwritten by TX_BYTE DO RDBYTE __param3, __param2 ' Read byte from hub IF __param2 = TERMINATOR THEN EXIT TX_BYTE __param2 INC __param3 ' Move to next byte in hub LOOP ENDSUB '{$ENDIF}In the DATA definition, the last byte is the termination byte and not transmitted. This could be whatever you like- just change the CONstant definition.
I hoped to use -1 as the termination byte but it fails (I guess obviously as we are talking bytes). Maybe Bean could suggest a smarter way, but for now this does the job !