serial write string produces unexpected output
in
Core Library Questions
•
1 year ago
I am using Processing to write commands to Firmata on an Arduino board. The command bytes flow without regard to handshaking or control characters, simply 8 bits of binay data.
The string of bytes, 0x91 0x20 0x00 (or 0x912000) will turn on the onboard pin 13 LED.
When I send a string with these bytes, the output actually sent to the Arduino is 0x3F2000 (observed with a sniffer on the serial port).
String s = {str(0x91),str(0x20),str(0x00)};
myport.write(s);
Serial write string uses Java getBytes(). Does this routine translate the data? Does the string data get translated somewhere such that 0x91 is converted to 0x3F?
1