Package edu.wpi.first.hal
Class AccelerometerJNI
java.lang.Object
edu.wpi.first.hal.JNIWrapper
edu.wpi.first.hal.AccelerometerJNI
Accelerometer HAL JNI methods.
- See Also:
-
- "hal/Accelerometer.h"
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.hal.JNIWrapper
JNIWrapper.Helper -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleGets the x-axis acceleration.static doubleGets the y-axis acceleration.static doubleGets the z-axis acceleration.static voidsetAccelerometerActive(boolean active) Sets the accelerometer to active or standby mode.static voidsetAccelerometerRange(int range) Sets the range of values that can be measured (either 2, 4, or 8 g-forces).Methods inherited from class edu.wpi.first.hal.JNIWrapper
forceLoad, suppressUnused
-
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()"
-