public class DualMotor extends Object implements Closeable
Constructor and Description |
---|
DualMotor(MotorInterface leftMotor,
MotorInterface rightMotor) |
Modifier and Type | Method and Description |
---|---|
void |
backward(float speed) |
void |
backwardLeft(float speed) |
void |
backwardRight(float speed) |
void |
circleLeft(float speed,
float turnRate) |
void |
circleRight(float speed,
float turnRate) |
void |
close() |
void |
forward(float speed) |
void |
forwardLeft(float speed) |
void |
forwardRight(float speed) |
MotorInterface |
getLeftMotor() |
MotorInterface |
getRightMotor() |
float[] |
getValues() |
void |
reverse() |
void |
rotateLeft(float speed) |
void |
rotateRight(float speed) |
void |
setValues(float leftValue,
float rightValue)
Set the speed and direction for both motors (clockwise / counter-clockwise)
|
void |
stop() |
public DualMotor(MotorInterface leftMotor, MotorInterface rightMotor)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public float[] getValues() throws RuntimeIOException
RuntimeIOException
public void setValues(float leftValue, float rightValue) throws RuntimeIOException
leftValue
- Range -1 .. 1. Positive numbers for clockwise, Negative numbers for counter clockwiserightValue
- Range -1 .. 1. Positive numbers for clockwise, Negative numbers for counter clockwiseRuntimeIOException
- if an I/O error occurspublic void forward(float speed) throws RuntimeIOException
RuntimeIOException
public void backward(float speed) throws RuntimeIOException
RuntimeIOException
public void rotateLeft(float speed) throws RuntimeIOException
RuntimeIOException
public void rotateRight(float speed) throws RuntimeIOException
RuntimeIOException
public void forwardLeft(float speed) throws RuntimeIOException
RuntimeIOException
public void forwardRight(float speed) throws RuntimeIOException
RuntimeIOException
public void backwardLeft(float speed) throws RuntimeIOException
RuntimeIOException
public void backwardRight(float speed) throws RuntimeIOException
RuntimeIOException
public void reverse() throws RuntimeIOException
RuntimeIOException
public void circleLeft(float speed, float turnRate)
public void circleRight(float speed, float turnRate)
public void stop() throws RuntimeIOException
RuntimeIOException
public MotorInterface getLeftMotor()
public MotorInterface getRightMotor()
Copyright © 2016 mattjlewis. All rights reserved.