public class DigitalMotor extends Object implements Closeable
Constructor and Description |
---|
DigitalMotor(GpioDeviceFactoryInterface deviceFactory,
int forwardGpio,
int backwardGpio) |
DigitalMotor(int forwardGpio,
int backwardGpio) |
Modifier and Type | Method and Description |
---|---|
void |
backward() |
void |
close() |
void |
forward() |
float |
getValue()
Represents the speed of the motor as a floating point value between -1
(full speed backward) and 1 (full speed forward)
|
boolean |
isActive() |
void |
reverse() |
void |
stop() |
public DigitalMotor(int forwardGpio, int backwardGpio) throws RuntimeIOException
RuntimeIOException
public DigitalMotor(GpioDeviceFactoryInterface deviceFactory, int forwardGpio, int backwardGpio) throws RuntimeIOException
RuntimeIOException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void forward() throws RuntimeIOException
RuntimeIOException
public void backward() throws RuntimeIOException
RuntimeIOException
public void stop() throws RuntimeIOException
RuntimeIOException
public void reverse() throws RuntimeIOException
RuntimeIOException
public boolean isActive() throws RuntimeIOException
RuntimeIOException
public float getValue() throws RuntimeIOException
RuntimeIOException
- if an I/O error occursCopyright © 2016–2017 mattjlewis. All rights reserved.