mindstorms
mindstorms copied to clipboard
Move motor to absolute position
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