From 41b83b4d1b1e3ef299265720bf55a6c5227985b0 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Mon, 12 Dec 2022 16:18:59 +0700 Subject: [PATCH] Update kuukar_motion.py --- kuukar/kuukar_motion.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kuukar/kuukar_motion.py b/kuukar/kuukar_motion.py index 13cbec0..046f6c7 100644 --- a/kuukar/kuukar_motion.py +++ b/kuukar/kuukar_motion.py @@ -162,6 +162,11 @@ class motion: time.sleep(0.3) def __roam_handle(self): - time.sleep(1) + if self.sensors.sonar_get_distance()<500: + self.turn(50,0.5) + time.sleep(0.1) + self.drive(25) + time.sleep(0.5) + time.sleep(0.5) if not self.roaming: self.stop() \ No newline at end of file