public class DIOUltrasonic
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static double |
ULTRASONIC_ERROR_CODE |
Constructor and Description |
---|
DIOUltrasonic(int tPin,
int ePin,
double horizontalOffset) |
Modifier and Type | Method and Description |
---|---|
double |
getDistance()
Gets the ultrasonic distance in inches adjusted for the angle to target and offset of the ultrasonic from the center of the robot.
|
double |
getUnadjustedDistance()
Gets the ultrasonic distance unadjusted for offset and angle to target
|
void |
setUltrasonicAutomaticMode(boolean automaticMode) |
public static final double ULTRASONIC_ERROR_CODE
public DIOUltrasonic(int tPin, int ePin, double horizontalOffset)
horizontalOffset
- horizontal offset from the center of the robot on the side it is on. Left is negative, right is positive.public double getDistance()
angle
- The angle to the target from the robot.public double getUnadjustedDistance()
public void setUltrasonicAutomaticMode(boolean automaticMode)