Clears or resets the encoder value associated with the DC motor. Encoder values are typically used to track the motor's rotational position.
lego_motor.M1.encoder_read()
Reads the encoder value of the DC motor. The encoder value is usually returned as an integer, representing the angle or steps the motor has rotated.
lego_motor.M1.set_pwm(0)
Sets the rotation direction and PWM (Pulse Width Modulation) value of the DC motor. The direction can be set to clockwise or counterclockwise, and the PWM value controls the motor's speed, usually ranging from 0 to 255.