ADXL362 SPI Accelerometer.
More...
#include <frc/ADXL362.h>
|
struct | AllAxes |
| Container type for accelerations from all axes. More...
|
|
ADXL362 SPI Accelerometer.
This class allows access to an Analog Devices ADXL362 3-axis accelerometer.
◆ Axes
Accelerometer axes.
Enumerator |
---|
kAxis_X | X axis.
|
kAxis_Y | Y axis.
|
kAxis_Z | Z axis.
|
◆ Range
Accelerometer range.
Enumerator |
---|
kRange_2G | 2 Gs max.
|
kRange_4G | 4 Gs max.
|
kRange_8G | 8 Gs max.
|
◆ ADXL362() [1/3]
Constructor.
Uses the onboard CS1.
- Parameters
-
range | The range (+ or -) that the accelerometer will measure. |
◆ ADXL362() [2/3]
Constructor.
- Parameters
-
port | The SPI port the accelerometer is attached to |
range | The range (+ or -) that the accelerometer will measure. |
◆ ~ADXL362()
frc::ADXL362::~ADXL362 |
( |
| ) |
|
|
overridedefault |
◆ ADXL362() [3/3]
frc::ADXL362::ADXL362 |
( |
ADXL362 && |
| ) |
|
|
default |
◆ GetAcceleration()
virtual double frc::ADXL362::GetAcceleration |
( |
Axes |
axis | ) |
|
|
virtual |
Get the acceleration of one axis in Gs.
- Parameters
-
axis | The axis to read from. |
- Returns
- Acceleration of the ADXL362 in Gs.
◆ GetAccelerations()
virtual AllAxes frc::ADXL362::GetAccelerations |
( |
| ) |
|
|
virtual |
Get the acceleration of all axes in Gs.
- Returns
- An object containing the acceleration measured on each axis of the ADXL362 in Gs.
◆ GetSpiPort()
◆ GetX()
double frc::ADXL362::GetX |
( |
| ) |
|
Returns the acceleration along the X axis in g-forces.
- Returns
- The acceleration along the X axis in g-forces.
◆ GetY()
double frc::ADXL362::GetY |
( |
| ) |
|
Returns the acceleration along the Y axis in g-forces.
- Returns
- The acceleration along the Y axis in g-forces.
◆ GetZ()
double frc::ADXL362::GetZ |
( |
| ) |
|
Returns the acceleration along the Z axis in g-forces.
- Returns
- The acceleration along the Z axis in g-forces.
◆ InitSendable()
Initializes this Sendable object.
- Parameters
-
Implements nt::NTSendable.
◆ operator=()
◆ SetRange()
void frc::ADXL362::SetRange |
( |
Range |
range | ) |
|
Set the measuring range of the accelerometer.
- Parameters
-
range | The maximum acceleration, positive or negative, that the accelerometer will measure. |
The documentation for this class was generated from the following file: