public abstract class MotorBase extends Object implements MotorInterface
Constructor and Description |
---|
MotorBase() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(MotorListener listener) |
void |
removeListener(MotorListener listener) |
void |
reverse()
Reverse direction of the motors
|
void |
setValue(float value)
Set the speed of the motor as a floating point value between -1 (full
speed backward) and 1 (full speed forward)
|
protected void |
valueChanged(float value) |
void |
whenBackward(Action action) |
void |
whenForward(Action action) |
void |
whenStop(Action action) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void reverse() throws RuntimeIOException
reverse
in interface MotorInterface
RuntimeIOException
- if an I/O error occurspublic void setValue(float value) throws RuntimeIOException
setValue
in interface MotorInterface
value
- Range -1 .. 1. Positive numbers for forward, Negative numbers for backwardRuntimeIOException
- if an I/O error occurspublic void whenForward(Action action)
whenForward
in interface MotorInterface
public void whenBackward(Action action)
whenBackward
in interface MotorInterface
public void whenStop(Action action)
whenStop
in interface MotorInterface
public void addListener(MotorListener listener)
addListener
in interface MotorInterface
public void removeListener(MotorListener listener)
removeListener
in interface MotorInterface
protected void valueChanged(float value)
Copyright © 2016 mattjlewis. All rights reserved.