BuiltInAccelerometer

class wpilib.BuiltInAccelerometer(range: wpilib.interfaces._interfaces.Accelerometer.Range = <Range.kRange_8G: 2>)

Bases: wpilib.interfaces._interfaces.Accelerometer, wpiutil._wpiutil.Sendable

Built-in accelerometer.

This class allows access to the roboRIO’s internal accelerometer.

Constructor.

Parameters

range – The range the accelerometer will measure

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.interfaces._interfaces.Accelerometer.Range) None

Set the measuring range of the accelerometer.

Parameters

range – The maximum acceleration, positive or negative, that the accelerometer will measure. Not all accelerometers support all ranges.