Python serial port event handler

I'm trying to write some code, triggering an event every time data arrives on the serial port. I am using pyserial but I cannot find any code that works.

the ones i found are like

for True:
    inputb = ord(ser.read(1))
    'Rest of the code'

      

But I'm looking for a way to add an event when a byte has been read using a function like DataReady () or similar function that can only fire an event when valid data arrives

Thank you for your help.

+3
python events serial-port


source to share


No one has answered this question yet

Check out similar questions:

1349
Why can't Python parse this JSON data?
531
jQuery find event handlers registered with object
2
Python serial port listener
1
C #: wait for serial port to complete ()
0
Raising a UI event handler from an event handler inside a serial port
0
C # Serial port Sending data without receivables
0
Python serial write - lost bytes
0
serial port blocking event flow event handler
0
Received serial port event in separate class from form
0
Received C # serial port event handler fires twice



All Articles
Loading...
X
Show
Funny
Dev
Pics