WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
ADXL362 Class Reference

ADXL362 SPI Accelerometer. More...

#include <ADXL362.h>

Inheritance diagram for ADXL362:
Accelerometer LiveWindowSendable Sendable

Classes

struct  AllAxes
 

Public Types

enum  Axes { kAxis_X = 0x00, kAxis_Y = 0x02, kAxis_Z = 0x04 }
 
- Public Types inherited from 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
 
virtual void SetRange (Range range) override
 {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.
}
 
virtual double GetX () override
 {Common interface for getting the x axis acceleration.
Returns
The acceleration along the x axis in g-forces
}
 
virtual double GetY () override
 {Common interface for getting the y axis acceleration.
Returns
The acceleration along the y axis in g-forces
}
 
virtual double GetZ () override
 {Common interface for getting the z axis acceleration.
Returns
The acceleration along the z axis in g-forces
}
 
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...
 
virtual std::string GetSmartDashboardType () const override
 
virtual void InitTable (std::shared_ptr< ITable > subtable) override
 Initializes a table for this sendable object. More...
 
virtual void UpdateTable () override
 Update the table for this sendable object with the latest values.
 
virtual std::shared_ptr< ITableGetTable () const override
 
virtual void StartLiveWindowMode () override
 Start having this sendable object automatically respond to value changes reflect the value on the table.
 
virtual 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)

Constructor.

Uses the onboard CS1.

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

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 Sendable.

std::shared_ptr< ITable > ADXL362::GetTable ( ) const
overridevirtual
Returns
the table that is currently associated with the sendable

Implements Sendable.

void ADXL362::InitTable ( std::shared_ptr< ITable subtable)
overridevirtual

Initializes a table for this sendable object.

Parameters
subtableThe table to put the values in.

Implements Sendable.


The documentation for this class was generated from the following files: