Package com.diozero.devices.motor
Class PiconZeroMotor
- java.lang.Object
-
- com.diozero.devices.motor.MotorBase
-
- com.diozero.devices.motor.PiconZeroMotor
-
- All Implemented Interfaces:
DeviceInterface
,FloatConsumer
,MotorInterface
,AutoCloseable
public class PiconZeroMotor extends MotorBase
-
-
Constructor Summary
Constructors Constructor Description PiconZeroMotor(PiconZero piconZero, int motor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
backward(float speed)
void
close()
Close this devicevoid
forward(float speed)
float
getValue()
Get the relative output value for the motorboolean
isActive()
void
stop()
-
Methods inherited from class com.diozero.devices.motor.MotorBase
accept, addListener, removeListener, reverse, setValue, whenBackward, whenForward, whenStop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.diozero.api.function.FloatConsumer
andThen
-
-
-
-
Constructor Detail
-
PiconZeroMotor
public PiconZeroMotor(PiconZero piconZero, int motor)
-
-
Method Detail
-
forward
public void forward(float speed) throws RuntimeIOException
- Throws:
RuntimeIOException
-
backward
public void backward(float speed) throws RuntimeIOException
- Throws:
RuntimeIOException
-
stop
public void stop() throws RuntimeIOException
- Throws:
RuntimeIOException
-
getValue
public float getValue() throws RuntimeIOException
Get the relative output value for the motor- Returns:
- -1 for full reverse, 1 for full forward, 0 for stop
- Throws:
RuntimeIOException
-
isActive
public boolean isActive() throws RuntimeIOException
- Throws:
RuntimeIOException
-
close
public void close()
Description copied from interface:DeviceInterface
Close this device
-
-