One of the worst
Java's implementation decisions -> signed
byte
primitive data-type!
Only primitive data-type which is unsigned is char, but it's 16 bits! While C's 8 bits.
You can also use 16-bit short, but it's signed!
I wonder whether it's possible to work this out.
When you read the unsigned byte from RS232 into Processing , store it in a short data-type variable.
Just before sending it back to RS232, use a (byte) cast operator upon the short variable's stored value.
Only primitive data-type which is unsigned is char, but it's 16 bits! While C's 8 bits.
You can also use 16-bit short, but it's signed!
I wonder whether it's possible to work this out.
When you read the unsigned byte from RS232 into Processing , store it in a short data-type variable.
Just before sending it back to RS232, use a (byte) cast operator upon the short variable's stored value.
short s = 150; byte b = (byte) s; println(s + "\t " + b); exit();