Go Down

Topic: How to open serial port with Python (Read 648 times) previous topic - next topic


Hi ,guys

I came across some port problem when I try to use python to do some tests. My serial port is COM5, actually.
When I use processing, I open the serial port by writing:
String portstr = Serial.list()[2]; port = new Serial(this, portstr, 9600);

but what about python? I write the code:SERIAL_PORT = "COM5";
ser = serial.Serial(SERIAL_PORT, 9600, timeout=1);
But unfortunately it does not work, can you give me some advices?

Go Up