![Python serial port read Python serial port read](/uploads/1/2/5/4/125410452/212182269.png)
![Java Java](/uploads/1/2/5/4/125410452/252078299.png)
Oct 12, 2015 - Since you are reading received data into array newData, you should replace System.out.println('Read ' + numRead + ' bytes.
Hi, I'm new here and i'm begginer in python programming. I need to convert c# code to python but i stuck when i wanted to read serial data as byte array. Here is the code: int byteToRead = P.serialPort.BytesToRead; byte inBuffer = new bytebyteToRead; P.serialPort.Read(inBuffer, 0, byteToRead); //Reads a number of characters from the System.IO.Ports.SerialPort input buffer and writes them into an array of characters at a given offset. Byte MatchStart = 242; // HEX: F2 byte MatchEnd = 248; // HEX: F8 I don't know how to convert the first 3 lines.