BuiltInAccelerometer
- class wpilib.BuiltInAccelerometer(range: wpilib._wpilib.BuiltInAccelerometer.Range = <Range.kRange_8G: 2>)
Bases:
Sendable
Built-in accelerometer.
This class allows access to the roboRIO’s internal accelerometer.
Constructor.
- Parameters:
range – The range the accelerometer will measure
- class Range(value: int)
Bases:
pybind11_object
Accelerometer range.
Members:
kRange_2G : 2 Gs max.
kRange_4G : 4 Gs max.
kRange_8G : 8 Gs max.
- kRange_2G = <Range.kRange_2G: 0>
- kRange_4G = <Range.kRange_4G: 1>
- kRange_8G = <Range.kRange_8G: 2>
- property name
- property value
- getX() float
- Returns:
The acceleration of the roboRIO along the X axis in g-forces
- getY() float
- Returns:
The acceleration of the roboRIO along the Y axis in g-forces
- getZ() float
- Returns:
The acceleration of the roboRIO along the Z axis in g-forces
- initSendable(builder: wpiutil._wpiutil.SendableBuilder) None
- setRange(range: wpilib._wpilib.BuiltInAccelerometer.Range) None
Set the measuring range of the accelerometer.
- Parameters:
range – The maximum acceleration, positive or negative, that the accelerometer will measure.