diff --git a/kuukar/kuukar_motion.py b/kuukar/kuukar_motion.py index f3dac78..3b987f1 100644 --- a/kuukar/kuukar_motion.py +++ b/kuukar/kuukar_motion.py @@ -27,9 +27,9 @@ class motion: def motor_write(self, forward_pin: int, reverse_pin: int, speed: int): if speed < 0: self.drv.pwm_write(forward_pin, 0) - self.drv.pwm_write(reverse_pin, -speed) + self.drv.pwm_write(reverse_pin, -int(speed)) elif speed >= 0: - self.drv.pwm_write(forward_pin, speed) + self.drv.pwm_write(forward_pin, int(speed)) self.drv.pwm_write(reverse_pin, 0) def drive(self, speed: int):