Package com.diozero.devices.motor
Interface MotorInterface
-
- All Superinterfaces:
AutoCloseable
,DeviceInterface
- All Known Implementing Classes:
MotorBase
,PiconZeroMotor
,PwmMotor
,TB6612FNGMotor
public interface MotorInterface extends DeviceInterface
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addListener(MotorEventListener listener)
void
backward(float speed)
void
forward(float speed)
float
getValue()
boolean
isActive()
void
removeListener(MotorEventListener listener)
void
reverse()
void
setValue(float value)
void
stop()
void
whenBackward(Action action)
void
whenForward(Action action)
void
whenStop(Action action)
-
Methods inherited from interface com.diozero.api.DeviceInterface
close
-
-
-
-
Method Detail
-
forward
void forward(float speed) throws RuntimeIOException
- Throws:
RuntimeIOException
-
backward
void backward(float speed) throws RuntimeIOException
- Throws:
RuntimeIOException
-
stop
void stop() throws RuntimeIOException
- Throws:
RuntimeIOException
-
reverse
void reverse() throws RuntimeIOException
- Throws:
RuntimeIOException
-
getValue
float getValue() throws RuntimeIOException
- Throws:
RuntimeIOException
-
setValue
void setValue(float value) throws RuntimeIOException
- Throws:
RuntimeIOException
-
isActive
boolean isActive() throws RuntimeIOException
- Throws:
RuntimeIOException
-
whenForward
void whenForward(Action action)
-
whenBackward
void whenBackward(Action action)
-
whenStop
void whenStop(Action action)
-
addListener
void addListener(MotorEventListener listener)
-
removeListener
void removeListener(MotorEventListener listener)
-
-