Package edu.wpi.first.wpilibj.interfaces
Interface Accelerometer
-
- All Known Implementing Classes:
ADXL345_I2C,ADXL345_SPI,ADXL362,BuiltInAccelerometer
public interface AccelerometerInterface for 3-axis accelerometers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAccelerometer.Range
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description doublegetX()Common interface for getting the x axis acceleration.doublegetY()Common interface for getting the y axis acceleration.doublegetZ()Common interface for getting the z axis acceleration.voidsetRange(Accelerometer.Range range)Common interface for setting the measuring range of an accelerometer.
-
-
-
Method Detail
-
setRange
void setRange(Accelerometer.Range range)
Common interface for setting the measuring range of an accelerometer.- Parameters:
range- The maximum acceleration, positive or negative, that the accelerometer will measure. Not all accelerometers support all ranges.
-
getX
double getX()
Common interface for getting the x axis acceleration.- Returns:
- The acceleration along the x axis in g-forces
-
getY
double getY()
Common interface for getting the y axis acceleration.- Returns:
- The acceleration along the y axis in g-forces
-
getZ
double getZ()
Common interface for getting the z axis acceleration.- Returns:
- The acceleration along the z axis in g-forces
-
-