Using a Raspi 2 B, I want to output serial data to an intelligent display that requires the following format:
\xhh\xhh
where hh represents a hex value.
The serial data is formed from various inputs which I concatenate using the following method:
SERDATA = ("\\x" + COMMAND + "\\x" + OBJECT)
printing SERDATA gives:
\\xhh\\xhh
Just printing "\\x" gives a single backslash and using only one escape character gives an invalid escape error, as expected. Where am I going wrong?