From 739a493b292be0a28aafc793525808d7e0b2df90 Mon Sep 17 00:00:00 2001 From: caternuson Date: Thu, 5 Dec 2024 09:27:21 -0800 Subject: [PATCH] flush uart before read --- adafruit_bno08x_rvc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/adafruit_bno08x_rvc.py b/adafruit_bno08x_rvc.py index 9d93f19..7ef4c12 100644 --- a/adafruit_bno08x_rvc.py +++ b/adafruit_bno08x_rvc.py @@ -121,6 +121,7 @@ def heading(self) -> Tuple[float, float, float, float, float, float]: """ # try to read initial packet start byte + self._uart.reset_input_buffer() data = None start_time = time.monotonic() while time.monotonic() - start_time < self._read_timeout: