My project requires that
Serial.read() be able to accept extended ASCII characters (
0xFF). For example, I would expect reading the character
¥ to yield the decimal value
157. Instead, the
read() command has two successful reads, with the values:
165. Of course, I could create a lookup table and convert, but this is not a viable option. I am conforming to the
Grbl standard protocol, which uses these single-byte extended ASCII characters as interrupts. Such a two-byte structure precludes a simple peek/read approach necessitated by the protocol.
Edit I tried to simplify the question for this context, but failed to account for the fact that the Arduino IDE will send the input as Unicode. Regardless, it still does not work when sending bytes directly. Namely, if I send the byte
0x93 via C# as
Serial.Write("\u0093"), the Arduino's
Serial.read() does not see any bytes available. Sending normal ASCII, e.g.,
Serial.Write("\u0018"), works fine.