Compare commits
2 Commits
41b83b4d1b
...
da809ad79d
Author | SHA1 | Date |
---|---|---|
Siwat Sirichai | da809ad79d | |
Siwat Sirichai | 42463e14d6 |
|
@ -159,14 +159,13 @@ class motion:
|
|||
while True:
|
||||
if self.roaming:
|
||||
self.__roam_handle()
|
||||
time.sleep(0.3)
|
||||
time.sleep(0.5)
|
||||
|
||||
def __roam_handle(self):
|
||||
if self.sensors.sonar_get_distance()<500:
|
||||
self.turn(50,0.5)
|
||||
self.turn(50,1.5)
|
||||
time.sleep(0.1)
|
||||
self.drive(25)
|
||||
time.sleep(0.5)
|
||||
time.sleep(0.5)
|
||||
if not self.roaming:
|
||||
self.stop()
|
Loading…
Reference in New Issue