public interface DcMotorSimple extends HardwareDevice
| Modifier and Type | Interface and Description |
|---|---|
static class |
DcMotorSimple.Direction
DcMotors can be configured to internally reverse the values
to which, e.g., their motor power is set.
|
HardwareDevice.Manufacturer| Modifier and Type | Method and Description |
|---|---|
DcMotorSimple.Direction |
getDirection()
Returns the current logical direction in which this motor is set as operating.
|
double |
getPower()
Returns the current configured power level of the motor.
|
void |
setDirection(DcMotorSimple.Direction direction)
Sets the logical direction in which this motor operates.
|
void |
setPower(double power)
Sets the power level of the motor, expressed as a fraction of the maximum
possible power / speed supported according to the run mode in which the
motor is operating.
|
close, getConnectionInfo, getDeviceName, getManufacturer, getVersion, resetDeviceConfigurationForOpModevoid setDirection(DcMotorSimple.Direction direction)
direction - the direction to set for this motorgetDirection()DcMotorSimple.Direction getDirection()
setDirection(Direction)void setPower(double power)
Setting a power level of zero will brake the motor
power - the new power level of the motor, a value in the interval [-1.0, 1.0]getPower(),
DcMotor.setMode(DcMotor.RunMode),
DcMotor.setPowerFloat()double getPower()
setPower(double)