deepsleep in the year progress
@@ -56,7 +56,7 @@ progress_bar = ProgressBar(
magtag.graphics.splash.append(progress_bar)
-while True:
+
try:
magtag.network.get_local_time()
now = rtc.RTC().datetime
@@ -66,9 +66,8 @@ while True:
)
print(now)
- time.sleep(24 * 60 * 60) # one day
- # We will use deep sleep once it's available in CircuitPython.
+ magtag.exit_and_deep_sleep(24 * 60 * 60) # one day
except (ValueError, RuntimeError) as e:
- print("Some error occurred, retrying! -", e)
- time.sleep(60) # one minute
+ print("Some error occurred, retrying after 1 minute! -", e)
+ magtag.exit_and_deep_sleep(60) # one minute
