WPILibC++ 2024.3.2
frc::Accelerometer Class Referenceabstract

Interface for 3-axis accelerometers. More...

#include <frc/interfaces/Accelerometer.h>

Public Types

enum  Range { kRange_2G = 0 , kRange_4G = 1 , kRange_8G = 2 , kRange_16G = 3 }
 Accelerometer range. More...
 

Public Member Functions

 Accelerometer ()=default
 
virtual ~Accelerometer ()=default
 
 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.

Deprecated:
This interface is being removed with no replacement.

Member Enumeration Documentation

◆ Range

Accelerometer range.

Enumerator
kRange_2G 

2 Gs max.

kRange_4G 

4 Gs max.

kRange_8G 

8 Gs max.

kRange_16G 

16 Gs max.

Constructor & Destructor Documentation

◆ Accelerometer() [1/2]

frc::Accelerometer::Accelerometer ( )
default

◆ ~Accelerometer()

virtual frc::Accelerometer::~Accelerometer ( )
virtualdefault

◆ Accelerometer() [2/2]

frc::Accelerometer::Accelerometer ( Accelerometer &&  )
default

Member Function Documentation

◆ GetX()

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

◆ GetY()

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

◆ GetZ()

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

◆ operator=()

Accelerometer & frc::Accelerometer::operator= ( Accelerometer &&  )
default

◆ SetRange()

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.

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