ADXL362 SPI Accelerometer.
More...
#include <ADXL362.h>
|
enum | Axes { kAxis_X = 0x00,
kAxis_Y = 0x02,
kAxis_Z = 0x04
} |
|
enum | Range { kRange_2G = 0,
kRange_4G = 1,
kRange_8G = 2,
kRange_16G = 3
} |
|
|
| ADXL362 (Range range=kRange_2G) |
| Constructor. More...
|
|
| ADXL362 (SPI::Port port, Range range=kRange_2G) |
| Constructor. More...
|
|
| ADXL362 (const ADXL362 &)=delete |
|
ADXL362 & | operator= (const ADXL362 &)=delete |
|
void | SetRange (Range range) override |
| Common interface for setting the measuring range of an accelerometer. More...
|
|
double | GetX () override |
| Common interface for getting the x axis acceleration. More...
|
|
double | GetY () override |
| Common interface for getting the y axis acceleration. More...
|
|
double | GetZ () override |
| Common interface for getting the z axis acceleration. More...
|
|
virtual double | GetAcceleration (Axes axis) |
| Get the acceleration of one axis in Gs. More...
|
|
virtual AllAxes | GetAccelerations () |
| Get the acceleration of all axes in Gs. More...
|
|
std::string | GetSmartDashboardType () const override |
|
void | InitTable (std::shared_ptr< ITable > subtable) override |
| Initializes a table for this sendable object. More...
|
|
void | UpdateTable () override |
| Update the table for this sendable object with the latest values.
|
|
std::shared_ptr< ITable > | GetTable () const override |
|
void | StartLiveWindowMode () override |
| Start having this sendable object automatically respond to value changes reflect the value on the table.
|
|
void | StopLiveWindowMode () override |
| Stop having this sendable object automatically respond to value changes.
|
|
ADXL362 SPI Accelerometer.
This class allows access to an Analog Devices ADXL362 3-axis accelerometer.
ADXL362::ADXL362 |
( |
Range |
range = kRange_2G | ) |
|
|
explicit |
Constructor.
Uses the onboard CS1.
- Parameters
-
range | The range (+ or -) that the accelerometer will measure. |
ADXL362::ADXL362 |
( |
SPI::Port |
port, |
|
|
Range |
range = kRange_2G |
|
) |
| |
|
explicit |
Constructor.
- Parameters
-
port | The SPI port the accelerometer is attached to |
range | The range (+ or -) that the accelerometer will measure. |
double ADXL362::GetAcceleration |
( |
ADXL362::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.
Get the acceleration of all axes in Gs.
- Returns
- An object containing the acceleration measured on each axis of the ADXL362 in Gs.
std::string ADXL362::GetSmartDashboardType |
( |
| ) |
const |
|
overridevirtual |
- Returns
- the string representation of the named data type that will be used by the smart dashboard for this sendable
Implements frc::Sendable.
std::shared_ptr< ITable > ADXL362::GetTable |
( |
| ) |
const |
|
overridevirtual |
- Returns
- the table that is currently associated with the sendable
Implements frc::Sendable.
Common interface for getting the x axis acceleration.
- Returns
- The acceleration along the x axis in g-forces
Implements frc::Accelerometer.
Common interface for getting the y axis acceleration.
- Returns
- The acceleration along the y axis in g-forces
Implements frc::Accelerometer.
Common interface for getting the z axis acceleration.
- Returns
- The acceleration along the z axis in g-forces
Implements frc::Accelerometer.
void ADXL362::InitTable |
( |
std::shared_ptr< ITable > |
subtable | ) |
|
|
overridevirtual |
Initializes a table for this sendable object.
- Parameters
-
subtable | The table to put the values in. |
Implements frc::Sendable.
void ADXL362::SetRange |
( |
Range |
range | ) |
|
|
overridevirtual |
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. |
Implements frc::Accelerometer.
The documentation for this class was generated from the following files:
- athena/include/ADXL362.h
- athena/src/ADXL362.cpp