Skip to content

Commit 80be1dd

Browse files
committed
Fix pulse animation bug
1 parent 55c6f8b commit 80be1dd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

micro/app/led.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def set(state):
379379
def set_effect(name):
380380
global effect
381381
effect = None
382-
if effect:
382+
if name:
383383
sleep_ms(1)
384384
effect = name
385385

@@ -472,14 +472,15 @@ def flash(color=None):
472472
def pulse(color=None, state=None):
473473
if color:
474474
set_gradient(set_color_gradient(color))
475-
476475
set_effect(EFFECT_PULSE)
477476

478477
state = state or copy()
479478
start_new_thread(pulse_thread, (state,))
480479

481480
def pulse_thread(state):
481+
global effect
482482
while (effect == EFFECT_PULSE):
483+
print('pulsing')
483484
# Fade out from 100% to 50%
484485
for i in range(20):
485486
for j in range(led_count):

micro/app/startup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def counter(callback_id, current_time, callback_memory):
2424

2525
def start_updater_chron():
2626
mcron.init_timer()
27-
mcron.insert(15 * 1000, {0}, '15m', counter) # Check update every 15 minutes
27+
mcron.insert(15 * 60 * 1000, {0}, '15m', counter) # Check update every 15 minutes
2828

2929
def my_exception_processor(e):
3030
print(e)

0 commit comments

Comments
 (0)