Modifier and Type | Field and Description |
---|---|
protected static int |
INVALID_MODE |
protected int |
mode |
protected BasicMotorPort |
port |
protected int |
power |
Constructor and Description |
---|
BasicMotor() |
Modifier and Type | Method and Description |
---|---|
void |
backward()
Causes motor to rotate backwards.
|
void |
flt()
Causes motor to float.
|
void |
forward()
Causes motor to rotate forward.
|
int |
getPower()
Returns the current motor power setting.
|
boolean |
isMoving()
Returns true iff the motor is in motion.
|
void |
setPower(int power)
Set the power level 0%-100% to be applied to the motor
|
void |
stop()
Causes motor to stop, pretty much
instantaneously.
|
protected void |
updateState(int newMode)
Update the internal state tracking the motor direction
|
close, releaseOnClose
protected static int INVALID_MODE
protected int mode
protected BasicMotorPort port
protected int power
public void setPower(int power)
DCMotor
public int getPower()
DCMotor
protected void updateState(int newMode)
newMode
- public void forward()
public void backward()
public boolean isMoving()
public void flt()