Closed JohnHZheng closed 4 years ago
Motor.position
should do it. It returns encoder pulses, so you can divide by Motor.count_per_rot
to get fractions of rotations.
If you want degrees:
my_motor.position * (360 / my_motor.count_per_rot)
thank you very much
We are now using Python 3. One question is that the LEGO EV3 MicroPython document has class Motor that read angle. The document reads: Methods for motors with rotation sensors angle() Get the rotation angle of the motor. Returns Motor angle. Return type angle: deg reset_angle(angle) Reset the accumulated rotation angle of the motor. Parameters angle (angle: deg) – Value to which the angle should be reset.
How do we get the same information using Python 3? Thank you