I am using the pyserial python library to read serial data from an Arduino. Polling for new data would require me to implement an update()
method that I must call several times a second. This would be slow and CPU intensive even when there is no communication happening.
Is there an OnSerialData()
event I can use? A routine that will execute every time new serial data arrives in the buffer? Most other languages I've worked with have an equivalent.
I am fairly unfamiliar with threading
but have a feeling it is involved.