BuiltInAccelerometer

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

Bases: wpilib.ErrorBase, wpilib.interfaces.Accelerometer, wpilib.Sendable

Built-in accelerometer.

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

Constructor.

Parameters

range – The range the accelerometer will measure

getX(self: wpilib.BuiltInAccelerometer) → float
Returns

The acceleration of the roboRIO along the X axis in g-forces

getY(self: wpilib.BuiltInAccelerometer) → float
Returns

The acceleration of the roboRIO along the Y axis in g-forces

getZ(self: wpilib.BuiltInAccelerometer) → float
Returns

The acceleration of the roboRIO along the Z axis in g-forces

initSendable(self: wpilib.BuiltInAccelerometer, builder: wpilib.SendableBuilder) → None
setRange(self: wpilib.BuiltInAccelerometer, 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.