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
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 Details
-
forward
- Throws:
RuntimeIOException
-
backward
- Throws:
RuntimeIOException
-
stop
- Throws:
RuntimeIOException
-
reverse
- Throws:
RuntimeIOException
-
getValue
- Throws:
RuntimeIOException
-
setValue
- Throws:
RuntimeIOException
-
isActive
- Throws:
RuntimeIOException
-
whenForward
-
whenBackward
-
whenStop
-
addListener
-
removeListener
-