from ev3dev2.motor import MediumMotor motor = MediumMotor('outA') motor.on(speed=50)
from ev3dev2.motor import MediumMotor motor = MediumMotor('outA') motor.on_for_degrees(speed=50, degrees=90)
from ev3dev2.motor import MediumMotor motor = MediumMotor('outA') motor.on_for_rotations(speed=50, rotations=-5)In these examples, we create a MediumMotor object by specifying the motor port (outA in this case). We then use the on(), on_for_degrees(), and on_for_rotations() methods to control the motor's speed and position. Overall, the ev3dev2.motor package library provides a variety of classes that can be used to control different types of motors on the LEGO EV3 robot, including the MediumMotor class for medium-sized motors.