de.jaetzold.art.platform
Interface MotorPeer
- All Superinterfaces:
- ActuatorPeer, SensorPeer
- All Known Subinterfaces:
- ServoPeer, StepperMotorPeer
- public interface MotorPeer
- extends ActuatorPeer
A MotorPeer gives direct access to the properties on, backward and power. This way it can be distinguished whether a motor is forward or backward and what power it has even when it is off. This is impossible if these states are mapped to a single raw-value like Motor
does it when only an ActuatorPeer
is available.
- See Also:
Motor
Method Summary |
boolean |
getBackward()
|
double |
getPower()
|
boolean |
isOn()
|
void |
setBackward(boolean backward)
Set the direction of the motor. |
void |
setOn(boolean on)
Switch the motor on or off depending on the value of on . |
void |
setPower(double power)
Set the power of the motor. |
setOn
public void setOn(boolean on)
- Switch the motor on or off depending on the value of
on
.
isOn
public boolean isOn()
setBackward
public void setBackward(boolean backward)
- Set the direction of the motor. Note that setting the direction does not imply switching the motor on.
- See Also:
setOn(boolean)
getBackward
public boolean getBackward()
setPower
public void setPower(double power)
- Set the power of the motor. Note that setting the power does not imply switching the motor on.
- See Also:
setOn(boolean)
getPower
public double getPower()