From bdb7d687bb3946e7fc79853030b339c071bab9a6 Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Sun, 5 Sep 2021 11:37:16 +0100 Subject: [PATCH] Fixed motor registers --- compLib/Motor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compLib/Motor.py b/compLib/Motor.py index 5eca21b..ba1bac3 100644 --- a/compLib/Motor.py +++ b/compLib/Motor.py @@ -34,16 +34,16 @@ class Motor(object): if port == 1: Spi.write(Register.MOTOR_1_PWM_H, 2, pwm) - Spi.write(Register.MOTOR_1_CTRL, 1, int(mode)) + Spi.write(Register.PWM_1_CTRL, 1, int(mode)) elif port == 2: Spi.write(Register.MOTOR_2_PWM_H, 2, pwm) - Spi.write(Register.MOTOR_2_CTRL, 1, int(mode)) + Spi.write(Register.PWM_2_CTRL, 1, int(mode)) elif port == 3: Spi.write(Register.MOTOR_3_PWM_H, 2, pwm) - Spi.write(Register.MOTOR_3_CTRL, 1, int(mode)) + Spi.write(Register.PWM_3_CTRL, 1, int(mode)) elif port == 4: Spi.write(Register.MOTOR_4_PWM_H, 2, pwm) - Spi.write(Register.MOTOR_4_CTRL, 1, int(mode)) + Spi.write(Register.PWM_4_CTRL, 1, int(mode)) @staticmethod def power(port: int, percent: float):