Accelerometer

class wpilib.interfaces.Accelerometer(self: wpilib.interfaces.Accelerometer) → None

Bases: pybind11_builtins.pybind11_object

Interface for 3-axis accelerometers.

class Range(self: wpilib.interfaces._interfaces.Accelerometer.Range, value: int) → None

Bases: pybind11_builtins.pybind11_object

Members:

kRange_2G

kRange_4G

kRange_8G

kRange_16G

kRange_16G = <Range.kRange_16G: 3>
kRange_2G = <Range.kRange_2G: 0>
kRange_4G = <Range.kRange_4G: 1>
kRange_8G = <Range.kRange_8G: 2>
property name
getX(self: wpilib.interfaces.Accelerometer) → float

Common interface for getting the x axis acceleration.

Returns

The acceleration along the x axis in g-forces

getY(self: wpilib.interfaces.Accelerometer) → float

Common interface for getting the y axis acceleration.

Returns

The acceleration along the y axis in g-forces

getZ(self: wpilib.interfaces.Accelerometer) → float

Common interface for getting the z axis acceleration.

Returns

The acceleration along the z axis in g-forces

setRange(self: wpilib.interfaces.Accelerometer, range: wpilib.interfaces._interfaces.Accelerometer.Range) → None

Common interface for setting the measuring range of an accelerometer.

Parameters

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