ADXL362¶
-
class
wpilib.
ADXL362
(range, port=None)[source]¶ Bases:
wpilib.SensorBase
ADXL362 SPI Accelerometer.
This class allows access to an Analog Devices ADXL362 3-axis accelerometer.
Constructor.
Parameters: - range (
ADXL362.Range
) – The range (+ or -) that the accelerometer will measure. - port (
SPI.Port
) – The SPI port that the accelerometer is connected to
-
getAcceleration
(axis)[source]¶ Get the acceleration of one axis in Gs.
Parameters: axis – The axis to read from. Returns: An object containing the acceleration measured on each axis in Gs.
-
getAccelerations
()[source]¶ Get the acceleration of all axes in Gs.
Returns: X,Y,Z tuple of acceleration measured on all axes in Gs.
-
kDataRegister
= 14¶
-
kFilterCtlRegister
= 44¶
-
kFilterCtl_ODR_100Hz
= 3¶
-
kFilterCtl_Range2G
= 0¶
-
kFilterCtl_Range4G
= 64¶
-
kFilterCtl_Range8G
= 128¶
-
kPartIdRegister
= 2¶
-
kPowerCtlRegister
= 45¶
-
kPowerCtl_AutoSleep
= 4¶
-
kPowerCtl_Measure
= 2¶
-
kPowerCtl_UltraLowNoise
= 32¶
-
kRegRead
= 11¶
-
kRegWrite
= 10¶
-
setRange
(range)[source]¶ Set the measuring range of the accelerometer.
Parameters: range ( ADXL362.Range
) – The maximum acceleration, positive or negative, that the accelerometer will measure.
- range (