From c49f940ca03f5456c70805dbd343741d4bf3750f Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Sat, 10 Dec 2022 16:11:14 +0700 Subject: [PATCH] Update kuukar_motion.py --- kuukar/kuukar_motion.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/kuukar/kuukar_motion.py b/kuukar/kuukar_motion.py index 2321746..e6cd4da 100644 --- a/kuukar/kuukar_motion.py +++ b/kuukar/kuukar_motion.py @@ -93,17 +93,17 @@ class motion: turn *=100 leftSpeed = speed - turn rightSpeed = speed + turn - if leftSpeed>990: leftSpeed=990 - elif leftSpeed<-990: leftSpeed= -990 - if rightSpeed>990: rightSpeed=990 - elif rightSpeed<-990: rightSpeed= -990 - if speed>990: speed=990 - elif speed<-990: speed= -990 + if leftSpeed>99: leftSpeed=99 + elif leftSpeed<-99: leftSpeed= -99 + if rightSpeed>99: rightSpeed=99 + elif rightSpeed<-99: rightSpeed= -99 + if speed>99: speed=99 + elif speed<-99: speed= -99 - self.motor_write(MOTOR_FL_F, MOTOR_FL_R, abs(leftSpeed/10)) - self.motor_write(MOTOR_FR_F, MOTOR_FR_R, abs(rightSpeed/10)) - self.motor_write(MOTOR_RL_F, MOTOR_RL_R, speed/10) - self.motor_write(MOTOR_RR_F, MOTOR_RR_R, speed/10) + self.motor_write(MOTOR_FL_F, MOTOR_FL_R, abs(leftSpeed)) + self.motor_write(MOTOR_FR_F, MOTOR_FR_R, abs(rightSpeed)) + self.motor_write(MOTOR_RL_F, MOTOR_RL_R, speed) + self.motor_write(MOTOR_RR_F, MOTOR_RR_R, speed)