from pybricks.pupdevices import Motor from pybricks.parameters import Port # Initialize a motor on port A. example_motor = Motor(Port.A) # Reset the angle to 0. example_motor.reset_angle(0) # Reset the angle to 1234. example_motor.reset_angle(1234) # Reset the angle to the absolute angle. # This is only supported on motors that have # an absolute encoder. For other motors, this # will raise an error. example_motor.reset_angle()