You can reference the available ports in the sensor commands using the following constants:
Device.MotorA
Device.MotorB
Device.MotorC
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
Stops a motor.
b.outputStop(0, Device.MotorA, Device.Brake);
Stops all motors.
b.outputStopAll();
Sets motor output power. Note that if power is negative, the motor direction is reversed.
b.outputPower(0, Device.MotorA, 50);
Starts a motor.
b.outputStart(0, Device.MotorA);
Tests whether or not a motor is busy (0 is ready, 1 is busy).
state = b.outputTest(0, Device.MotorA);
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);
Clear a motor tachometer.
b.outputClrCount(0,Device.MotorA);
Returns the tachometer of a motor.
tacho = b.outputGetCount(0,Device.MotorA);