We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a188c77 + a807d0f commit 2926b90Copy full SHA for 2926b90
examples/magtag_quote_demo.py
@@ -2,7 +2,6 @@
2
#
3
# SPDX-License-Identifier: Unlicense
4
import os
5
-import time
6
from adafruit_magtag.magtag import MagTag
7
8
# Set up where we'll be fetching data from
@@ -55,10 +54,9 @@ def add_hyphen(author_name):
55
54
text_transform=add_hyphen,
56
)
57
58
-while True:
59
- try:
60
- value = magtag.fetch()
61
- print("Response is", value)
62
- except (ValueError, RuntimeError) as e:
63
- print("Some error occured, retrying! -", e)
64
- time.sleep(180)
+try:
+ value = magtag.fetch()
+ print("Response is", value)
+except (ValueError, RuntimeError) as e:
+ print("Some error occured, retrying! -", e)
+magtag.exit_and_deep_sleep(60)
0 commit comments