I am trying to implement a simple interface using an existing serial protocol
The protocol requires a version number to be output as V1007; - however the numbers are actual byte codes - not the string "1007" i.e. byte codes would be 0x56,0x01,0x00,0x00,0x07,0x3b
I can try to create such a string with :
version = "V" + String.fromCharCode(1) + String.fromCharCode(0) + String.fromCharCode(0)+String.fromCharCode(7)
However the String.fromCharCode(0) does not appear to generate the required 0x00 - following the above the string "version" shows as length 3 -and when output to serial is missing the required 0x00. (the byte codes for 0x01 and 0x07 are present as required)
Any other suggestions for creating the required 0x00 within a serial output ?