from adafruit_crickit import crickit class Drivetrain: #constructor def __init__(self): self.speed_right = -0.8 self.speed_left = 0.8 self.left_motor = crickit.dc_motor_2 self.right_motor = crickit.dc_motor_1 #methods (functions) def forward(self): self.left_motor.throttle = self.speed_left self.right_motor.throttle = self.speed_right def stop(self): self.left_motor.throttle = 0 self.right_motor.throttle = 0 def back(self): self.left_motor.throttle = -self.speed_left self.right_motor.throttle = -self.speed_right def left(self): self.left_motor.throttle = self.speed_left self.right_motor.throttle = -self.speed_right def right(self): self.right_motor.throttle = self.speed_right self.left_motor.throttle = -self.speed_left