Motors
To connect from the MATLAB® software to the EV3 Large or Medium Motor (item number 45502 or 45503), use the
motor
function to create a motor
object.
To control the speed and direction of the motor, assign a value to the
Speed
property of themotor
object. Input values range from-100
to100
(full reverse to full forward). The default value of theSpeed
property is0
. You can change this value while the motor is running or stopped.To start and stop the motor, use the
start
andstop
functions with themotor
object.To measure the total rotation of the motor in degrees, use the
readRotation
function with themotor
object. Driving the motor forward increases the value. Driving the motor in reverse decreases the value.To reset the number of degrees to zero, use the
resetRotation
function with themotor
object.