Skip to content

Commit

Permalink
Fix incorrect warning
Browse files Browse the repository at this point in the history
Clear the incoming serial buffer before writing each command so the correct echo is read
  • Loading branch information
ercdndrs authored Jan 4, 2021
1 parent 2d4f50c commit 7ff66af
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions MaxLairInstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ def push_buttons(self, *commands: Tuple[str, float]) -> None:
# then we release the lock so the display thread can run while we complete the button press and subsequent delay
self.lock.release()

# Clear extra characters from the serial buffer
self.com.reset_input_buffer()

# then we send the command to the microcontroller using the serial port
self.com.write(character)

Expand Down

0 comments on commit 7ff66af

Please sign in to comment.