Discovery problems
This commit is contained in:
@@ -881,6 +881,7 @@ def main():
|
||||
now = 0
|
||||
|
||||
while True:
|
||||
was_moving = False
|
||||
try:
|
||||
now = utime.ticks_ms()
|
||||
|
||||
@@ -902,11 +903,15 @@ def main():
|
||||
for _ in range(abs(steps_to_move)):
|
||||
g.step(direction)
|
||||
moved_any = True
|
||||
was_moving = True
|
||||
|
||||
if moved_any:
|
||||
delay_us = 1_000_000 // MICROSTEPS_PER_SECOND
|
||||
utime.sleep_us(delay_us)
|
||||
else:
|
||||
if was_moving:
|
||||
publish_state(client_ref)
|
||||
was_moving = False
|
||||
utime.sleep_ms(10)
|
||||
|
||||
if utime.ticks_diff(utime.ticks_ms(), last_heartbeat) > 10000:
|
||||
|
||||
Reference in New Issue
Block a user