Reputation: 43
How to change timeout in Pyserial after initialize serial?
Like:
ser=serial.Serial("COM4", baudrate=19200,parity=serial.PARITY_NONE,stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS,timeout=0.5)
After that, I want to change timeout.
Any examples?
Thanks
B.R.
Upvotes: 3
Views: 12694
Reputation: 1368
Looking at the docs (https://pythonhosted.org/pyserial/pyserial_api.html#serial.Serial.timeout) it seems as though you should simply have to set the attribute on the object:
ser.timeout = 1.0
Upvotes: 6