better handle roaming loop
This commit is contained in:
parent
ded055a790
commit
88734ec168
|
@ -79,5 +79,5 @@ class leds:
|
|||
print(leds.__blink_func(self.__get_time(), duration))
|
||||
time.sleep(0.05)
|
||||
if self.__get_time() > duration:
|
||||
flashing = False
|
||||
self.flashing = False
|
||||
break
|
||||
|
|
|
@ -110,6 +110,7 @@ class motion:
|
|||
while True:
|
||||
if self.roaming:
|
||||
self.__roam_handle()
|
||||
time.sleep(0.3)
|
||||
|
||||
def __roam_handle(self):
|
||||
sensitivity = 35
|
||||
|
@ -149,5 +150,4 @@ class motion:
|
|||
self.turn(-turn_speed, 1)
|
||||
self.drive(drive_speed)
|
||||
if not self.roaming:
|
||||
self.stop()
|
||||
time.sleep(0.3)
|
||||
self.stop()
|
Loading…
Reference in New Issue