lejos.robotics.BaseMotor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lejos-ev3-api Show documentation
Show all versions of lejos-ev3-api Show documentation
leJOS (pronounced like the Spanish word "lejos" for "far") is a tiny Java Virtual Machine. In 2013 it was ported to the LEGO EV3 brick.
The newest version!
package lejos.robotics;
/**
* Base motor interface. Contains basic movement commands.
*
*/
public interface BaseMotor {
/**
* Causes motor to rotate forward until stop()
or flt()
is called.
*/
void forward();
/**
* Causes motor to rotate backwards until stop()
or flt()
is called.
*/
void backward();
/**
* Causes motor to stop immediately. It will resist any further motion. Cancels any rotate() orders in progress.
*/
void stop();
/**
* Motor loses all power, causing the rotor to float freely to a stop.
* This is not the same as stopping, which locks the rotor.
*/
public void flt();
/**
* Return true
if the motor is moving.
*
* @return true
if the motor is currently in motion, false
if stopped.
*/
// TODO: Possibly part of Encoder interface? Depends if encoder used to determine this.
boolean isMoving();
}