Add tempo, live status

This commit is contained in:
siinus
2021-03-19 19:00:41 +02:00
parent 57559ea70a
commit 76759f986b
8 changed files with 143 additions and 24 deletions

View File

@@ -9,6 +9,7 @@ def name():
# Tick seconds like analog clock
class HzTick(Program):
def run(self, args: [] = None) -> None:
tempo = self._lm.get_tempo()
while self.get_loop().status():
second = time.localtime().tm_sec
@@ -17,8 +18,5 @@ class HzTick(Program):
for i in range(self._lm.count_pixels()):
self._lm.set_pixel_color(i, (color_arr[0] << 16) | (color_arr[1] << 8) | color_arr[2])
self._lm.set_pixel_color(second_pixel, 255)
self._lm.show()
# Needs accurate time calculation to tick exactly when real second is passed
time.sleep(1)
tempo.wait()