WPILibC++  2019.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
frc::Accelerometer Class Referenceabstract

Interface for 3-axis accelerometers. More...

#include <Accelerometer.h>

Inheritance diagram for frc::Accelerometer:
frc::ADXL345_I2C frc::ADXL345_SPI frc::ADXL362 frc::BuiltInAccelerometer

Public Types

enum  Range { kRange_2G = 0, kRange_4G = 1, kRange_8G = 2, kRange_16G = 3 }
 

Public Member Functions

 Accelerometer (Accelerometer &&)=default
 
Accelerometeroperator= (Accelerometer &&)=default
 
virtual void SetRange (Range range)=0
 Common interface for setting the measuring range of an accelerometer. More...
 
virtual double GetX ()=0
 Common interface for getting the x axis acceleration. More...
 
virtual double GetY ()=0
 Common interface for getting the y axis acceleration. More...
 
virtual double GetZ ()=0
 Common interface for getting the z axis acceleration. More...
 

Detailed Description

Interface for 3-axis accelerometers.

Member Function Documentation

virtual double frc::Accelerometer::GetX ( )
pure virtual

Common interface for getting the x axis acceleration.

Returns
The acceleration along the x axis in g-forces

Implemented in frc::ADXL362, frc::ADXL345_I2C, frc::ADXL345_SPI, and frc::BuiltInAccelerometer.

virtual double frc::Accelerometer::GetY ( )
pure virtual

Common interface for getting the y axis acceleration.

Returns
The acceleration along the y axis in g-forces

Implemented in frc::ADXL362, frc::BuiltInAccelerometer, frc::ADXL345_I2C, and frc::ADXL345_SPI.

virtual double frc::Accelerometer::GetZ ( )
pure virtual

Common interface for getting the z axis acceleration.

Returns
The acceleration along the z axis in g-forces

Implemented in frc::BuiltInAccelerometer, frc::ADXL362, frc::ADXL345_I2C, and frc::ADXL345_SPI.

virtual void frc::Accelerometer::SetRange ( Range  range)
pure virtual

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.

Implemented in frc::ADXL362, frc::ADXL345_I2C, frc::ADXL345_SPI, and frc::BuiltInAccelerometer.


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