We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 560fcaf commit 997cf54Copy full SHA for 997cf54
ntp_simple_demo/ntp_demo_native.py
@@ -64,6 +64,7 @@ def get_ntp_time(pool):
64
# insert external display init
65
66
if display:
67
+ display.auto_refresh = False
68
group = displayio.Group()
69
display.show(group)
70
text_area = label.Label(
@@ -78,14 +79,19 @@ def get_ntp_time(pool):
78
79
text="Hello",
80
)
81
group.append(text_area)
82
+ display.refresh()
83
84
+previous_clock = ""
85
86
while True:
87
now = time.localtime()
88
clock = "{hour:02d}:{min:02d}:{seconds:02d}".format(
89
hour=now.tm_hour, min=now.tm_min, seconds=now.tm_sec
90
- print(clock)
- if display:
- text_area.text = clock
91
+ if clock != previous_clock:
92
+ print(clock)
93
+ if display:
94
+ text_area.text = clock
95
96
+ previous_clock = clock
97
time.sleep(0.2)
0 commit comments