diff --git a/adafruit_display_text/scrolling_label.py b/adafruit_display_text/scrolling_label.py index 91206ec..2031c5d 100644 --- a/adafruit_display_text/scrolling_label.py +++ b/adafruit_display_text/scrolling_label.py @@ -26,7 +26,7 @@ __version__ = "0.0.0+auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Display_Text.git" -import time +import adafruit_ticks from adafruit_display_text import bitmap_label try: @@ -81,8 +81,10 @@ def update(self, force: bool = False) -> None: Default is False. :return: None """ - _now = time.monotonic() - if force or self._last_animate_time + self.animate_time <= _now: + _now = adafruit_ticks.ticks_ms() + if force or adafruit_ticks.ticks_less( + self._last_animate_time + int(self.animate_time * 1000), _now + ): if len(self.full_text) <= self.max_characters: super()._set_text(self.full_text, self.scale) self._last_animate_time = _now diff --git a/docs/conf.py b/docs/conf.py index a355fd3..de06824 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -27,7 +27,12 @@ # Uncomment the below if you use native CircuitPython modules such as # digitalio, micropython and busio. List the modules you use. Without it, the # autodoc module docs will fail to generate with a warning. -autodoc_mock_imports = ["displayio", "adafruit_bitmap_font", "fontio", "bitmaptools"] +autodoc_mock_imports = [ + "displayio", + "adafruit_bitmap_font", + "fontio", + "bitmaptools", +] intersphinx_mapping = { diff --git a/requirements.txt b/requirements.txt index cb4ca17..cdc14cf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ Adafruit-Blinka-displayio>=0.10.2 Adafruit-Blinka adafruit-circuitpython-bitmap-font +adafruit-circuitpython-ticks