mindstorms icon indicating copy to clipboard operation
mindstorms copied to clipboard

Move motor to absolute position

Open KonerDev opened this issue 1 year ago • 0 comments

How can I set the motor A to 20°, for example?

import mindstorms
import time

hub = mindstorms.Hub()

time.sleep(1)

motor_a = hub.port.A.motor
motor_a.run_to_position(20)

Because this code only moves the motor +20° relative to its position at start-up

KonerDev avatar Aug 04 '23 08:08 KonerDev