I’m using python (together with a python library called pySerial) to transmit a 2 digit number over the Serial port.
Then from the arduino code I am trying to read the value of this 2 digit number using the Serial.read() However it reads data as ASCII characters by default, and only read the first ASCII character and ignores the second character.
I tried converting the number being sent from the Python side to be transmitted as a binary number, but the arduino still only reads the first digit and disregards the rest of the digits. And yes I am using a loop to try read the 8 binary digits: here’s the code:
readBinaryFromSerial[posCounter] = Serial.read();
} while (++posCounter < 8);
Can anybody help me please? Is it possible to read a 2 digit number over serial as an ASCII character or can it only be done in Binary, and if so how do I code the Arduino to read it?
Please help me out guys