Package edu.wpi.first.hal
Class AccelerometerJNI
java.lang.Object
edu.wpi.first.hal.JNIWrapper
edu.wpi.first.hal.AccelerometerJNI
public class AccelerometerJNI extends JNIWrapper
Accelerometer HAL JNI methods.
- See Also:
- "hal/Accelerometer.h"
-
Nested Class Summary
-
Method Summary
Modifier and Type Method Description static double
getAccelerometerX()
Gets the x-axis acceleration.static double
getAccelerometerY()
Gets the y-axis acceleration.static double
getAccelerometerZ()
Gets the z-axis acceleration.static void
setAccelerometerActive(boolean active)
Sets the accelerometer to active or standby mode.static void
setAccelerometerRange(int range)
Sets the range of values that can be measured (either 2, 4, or 8 g-forces).
-
Method Details
-
setAccelerometerActive
Sets the accelerometer to active or standby mode.It must be in standby mode to change any configuration.
- Parameters:
active
- true to set to active, false for standby- See Also:
- "HAL_SetAccelerometerActive"
-
setAccelerometerRange
Sets the range of values that can be measured (either 2, 4, or 8 g-forces).The accelerometer should be in standby mode when this is called.
- Parameters:
range
- the accelerometer range- See Also:
- "HAL_SetAccelerometerRange(int range)"
-
getAccelerometerX
Gets the x-axis acceleration.This is a floating point value in units of 1 g-force.
- Returns:
- the X acceleration
- See Also:
- "HAL_GetAccelerometerX()"
-
getAccelerometerY
Gets the y-axis acceleration.This is a floating point value in units of 1 g-force.
- Returns:
- the Y acceleration
- See Also:
- "HAL_GetAccelerometerY()"
-
getAccelerometerZ
Gets the z-axis acceleration.This is a floating point value in units of 1 g-force.
- Returns:
- the Z acceleration
- See Also:
- "HAL_GetAccelerometerZ()"
-