Hello Community,
For this application, I am using C# in Visual Studio to send values ranging from -1000 to 1000, to an Arduino Due via serial port. On the Due, I have it echoing back.
The only numbers that work well is between 0 - 255, which to me is obvious because Serial.read() reads one byte of data. How do I implement (preferably on the Arduino side) to read and construct signed integers with the range that I mentioned?
First, I would like to just learn how to send a signed byte via Serial.read() from -128 to 127. I seem to not be able to get that to work :-(.
Nothing too much to see, but on the Arduino side, the following code is being used:
void setup()
{
Serial.begin(115200);
}
byte inByte = 0;
void serialEvent() {
inByte = Serial.read();
Serial.println(inByte);
}
void loop()
{
}