Package lejos.robotics
Interface BaseMotor
-
- All Known Subinterfaces:
DCMotor,EncoderMotor,RegulatedMotor
- All Known Implementing Classes:
BaseRegulatedMotor,BasicMotor,EV3LargeRegulatedMotor,EV3MediumRegulatedMotor,MindsensorsGlideWheelMRegulatedMotor,MindsensorsGlideWheelXLRegulatedMotor,MirrorMotor,MMXMotor,MMXRegulatedMotor,NXTRegulatedMotor,PFMateMotor,RCXMotor,RemoteRequestRegulatedMotor,TetrixEncoderMotor,TetrixMotor,TetrixRegulatedMotor,UnregulatedMotor
public interface BaseMotorBase motor interface. Contains basic movement commands.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbackward()Causes motor to rotate backwards untilstop()orflt()is called.voidflt()Motor loses all power, causing the rotor to float freely to a stop.voidforward()Causes motor to rotate forward untilstop()orflt()is called.booleanisMoving()Returntrueif the motor is moving.voidstop()Causes motor to stop immediately.
-
-
-
Method Detail
-
forward
void forward()
Causes motor to rotate forward untilstop()orflt()is called.
-
backward
void backward()
Causes motor to rotate backwards untilstop()orflt()is called.
-
stop
void stop()
Causes motor to stop immediately. It will resist any further motion. Cancels any rotate() orders in progress.
-
flt
void flt()
Motor loses all power, causing the rotor to float freely to a stop. This is not the same as stopping, which locks the rotor.
-
isMoving
boolean isMoving()
Returntrueif the motor is moving.- Returns:
trueif the motor is currently in motion,falseif stopped.
-
-