Go Down

Topic: How to open serial port with Python (Read 468 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

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131