MCPcopy Index your code
hub / github.com/FrameworkComputer/inputmodule-rs / clock

Function clock

python/inputmodule/gui/ledmatrix.py:72–84  ·  view source on GitHub ↗

Render the current time and display. Loops forever, updating every second

(dev)

Source from the content-addressed store, hash-verified

70
71
72def clock(dev):
73 """Render the current time and display.
74 Loops forever, updating every second"""
75 while True:
76 if is_thread_stopped() or is_dev_disconnected(dev.device):
77 reset_thread()
78 return
79 now = datetime.now()
80 current_time = now.strftime("%H:%M")
81 print("Current Time =", current_time)
82
83 show_string(dev, current_time)
84 time.sleep(1)

Callers 1

main_cliFunction · 0.90

Calls 4

is_thread_stoppedFunction · 0.90
is_dev_disconnectedFunction · 0.90
reset_threadFunction · 0.90
show_stringFunction · 0.90

Tested by

no test coverage detected