WPILibC++  unspecified
frc::ADXL362 Class Reference

ADXL362 SPI Accelerometer. More...

#include <ADXL362.h>

Inheritance diagram for frc::ADXL362:
Collaboration diagram for frc::ADXL362:

Classes

struct  AllAxes
 

Public Types

enum  Axes { kAxis_X = 0x00, kAxis_Y = 0x02, kAxis_Z = 0x04 }
 
- Public Types inherited from frc::Accelerometer
enum  Range { kRange_2G = 0, kRange_4G = 1, kRange_8G = 2, kRange_16G = 3 }
 

Public Member Functions

 ADXL362 (Range range=kRange_2G)
 Constructor. More...
 
 ADXL362 (SPI::Port port, Range range=kRange_2G)
 Constructor. More...
 
 ADXL362 (const ADXL362 &)=delete
 
ADXL362operator= (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< nt::NetworkTable > subtable) override
 Initializes a table for this sendable object. More...
 
void UpdateTable () override
 Update the table for this sendable object with the latest values.
 
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.
 

Detailed Description

ADXL362 SPI Accelerometer.

This class allows access to an Analog Devices ADXL362 3-axis accelerometer.

Constructor & Destructor Documentation

ADXL362::ADXL362 ( Range  range = kRange_2G)
explicit

Constructor.

Uses the onboard CS1.

Parameters
rangeThe range (+ or -) that the accelerometer will measure.
ADXL362::ADXL362 ( SPI::Port  port,
Range  range = kRange_2G 
)
explicit

Constructor.

Parameters
portThe SPI port the accelerometer is attached to
rangeThe range (+ or -) that the accelerometer will measure.

Member Function Documentation

double ADXL362::GetAcceleration ( ADXL362::Axes  axis)
virtual

Get the acceleration of one axis in Gs.

Parameters
axisThe axis to read from.
Returns
Acceleration of the ADXL362 in Gs.
ADXL362::AllAxes 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.
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.

double ADXL362::GetX ( )
overridevirtual

Common interface for getting the x axis acceleration.

Returns
The acceleration along the x axis in g-forces

Implements frc::Accelerometer.

double ADXL362::GetY ( )
overridevirtual

Common interface for getting the y axis acceleration.

Returns
The acceleration along the y axis in g-forces

Implements frc::Accelerometer.

double ADXL362::GetZ ( )
overridevirtual

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< nt::NetworkTable subtable)
overridevirtual

Initializes a table for this sendable object.

Parameters
subtableThe 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
rangeThe 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: