BuiltInAccelerometer¶
-
class
wpilib.
BuiltInAccelerometer
(range=2)[source]¶ Bases:
wpilib.SensorBase
Built-in accelerometer device
This class allows access to the roboRIO’s internal accelerometer.
Constructor.
Parameters: range ( Accelerometer.Range
) – The range the accelerometer will measure. Defaults to +/-8g if unspecified.-
getX
()[source]¶ Returns: The acceleration of the roboRIO along the X axis in g-forces Return type: float
-
getY
()[source]¶ Returns: The acceleration of the roboRIO along the Y axis in g-forces Return type: float
-
getZ
()[source]¶ Returns: The acceleration of the roboRIO along the Z axis in g-forces Return type: float
-
setRange
(range)[source]¶ Set the measuring range of the accelerometer.
Parameters: range ( BuiltInAccelerometer.Range
) – The maximum acceleration, positive or negative, that the accelerometer will measure.
-