The library uses the following code to flush the buffer before a new read is started:
self.serial.flush() #Flush any data in the buffer
IMO the correct code should be:
self.serial.reset_input_buffer()
The function flush() just makes sure everything gets written. I assume the author of the code would make sure a current reading is made and no past readings from the buffer are used.
The library uses the following code to flush the buffer before a new read is started:
self.serial.flush() #Flush any data in the buffer
IMO the correct code should be:
self.serial.reset_input_buffer()
The function
flush()
just makes sure everything gets written. I assume the author of the code would make sure a current reading is made and no past readings from the buffer are used.