EV3 Matlab Toolkit - Motors Reference¶
Ports¶
You can reference the available ports in the sensor commands using the following constants:
Device.MotorADevice.MotorBDevice.MotorC
Break types¶
You can stop the motor with two different brake types:
Device.Brake– attempt to stop the motor instantlyDevice.Coast– slowly wind down the motor to a complete stop
Commands¶
outputPower(layer, nos, power)¶
Sets motor output power. Note that if power is negative, the motor direction is reversed.
b.outputPower(0, Device.MotorA, 50);
outputTest(layer, nos)¶
Tests whether or not a motor is busy (0 is ready, 1 is busy).
state = b.outputTest(0, Device.MotorA);
outputStepSpeed(layer, nos, speed, step1, step2, step3, brake)¶
Moves a motor to a set position with layer, NOS, speed, ramp up angle, constant angle, ramp down angle and brake type.
b.outputStepSpeed(0,Device.MotorA,50,50,360,50,Device.Coast);
outputGetCount(layer,nos)¶
Returns the tachometer of a motor.
tacho = b.outputGetCount(0,Device.MotorA);