From f8d114c8add923b3bcaa2c53c7912c269d537d5d Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Sun, 24 Sep 2023 19:36:04 -0700 Subject: [PATCH] Fix for issue 15, use the new display.time_to_refresh --- examples/ssd1680_2.13_featherwing.py | 12 +++++++++++- examples/ssd1680_simpletest.py | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/examples/ssd1680_2.13_featherwing.py b/examples/ssd1680_2.13_featherwing.py index b579c56..2732f83 100644 --- a/examples/ssd1680_2.13_featherwing.py +++ b/examples/ssd1680_2.13_featherwing.py @@ -57,4 +57,14 @@ print("refreshed") - time.sleep(120) + time.sleep(display.time_to_refresh + 5) + # Always refresh a little longer. It's not a problem to refresh + # a few seconds more, but it's terrible to refresh too early + # (the display will throw an exception when if the refresh + # is too soon) + print("waited correct time") + + +# Keep the display the same +while True: + time.sleep(10) diff --git a/examples/ssd1680_simpletest.py b/examples/ssd1680_simpletest.py index 9ce4f1f..a545412 100644 --- a/examples/ssd1680_simpletest.py +++ b/examples/ssd1680_simpletest.py @@ -64,4 +64,14 @@ print("refreshed") - time.sleep(120) + time.sleep(display.time_to_refresh + 5) + # Always refresh a little longer. It's not a problem to refresh + # a few seconds more, but it's terrible to refresh too early + # (the display will throw an exception when if the refresh + # is too soon) + print("waited correct time") + + +# Keep the display the same +while True: + time.sleep(10)