myWRIO
C++ framework for NationalInstruments myRIO
myRIO::Acc Class Reference

Embedded accelerometer. More...

#include <Acc.h>

Public Member Functions

 Acc ()
 Constructs an Accelerometer. More...
 
 ~Acc ()
 
void x (double &v)
 Read the accelerometer value on the x axis. More...
 
void y (double &v)
 Read the accelerometer value on the y axis. More...
 
void z (double &v)
 Read the accelerometer value on the z axis. More...
 
void all (double &x, double &y, double &z)
 Read the accelerometer value on each axis. More...
 

Private Member Functions

void readAcc (int, double &)
 Get the acceleration for an axis. More...
 

Private Attributes

double scale
 

Detailed Description

Embedded accelerometer.

Examples
example_acc.cpp, project_angle.cpp, and project_pendulum.cpp.

Definition at line 13 of file Acc.h.

Constructor & Destructor Documentation

◆ Acc()

Acc::Acc ( )

Constructs an Accelerometer.

Set the scale to the default (1/256)

Definition at line 10 of file Acc.cpp.

◆ ~Acc()

Acc::~Acc ( )

Definition at line 69 of file Acc.cpp.

Member Function Documentation

◆ all()

void Acc::all ( double &  vx,
double &  vy,
double &  vz 
)

Read the accelerometer value on each axis.

Parameters
vxAcceleration on x axis
vyAcceleration on y axis
vzAcceleration on z axis
Examples
example_acc.cpp.

Definition at line 62 of file Acc.cpp.

◆ readAcc()

void Acc::readAcc ( int  type,
double &  v 
)
private

Get the acceleration for an axis.

Parameters
typeOne of ACCXVAL, ACCYVAL or ACCZVAL
vThe return value, passed by reference

Definition at line 19 of file Acc.cpp.

◆ x()

void Acc::x ( double &  v)

Read the accelerometer value on the x axis.

Parameters
vThe result is given by reference for speed

Definition at line 36 of file Acc.cpp.

◆ y()

void Acc::y ( double &  v)

Read the accelerometer value on the y axis.

Parameters
vThe result is given by reference for speed
Examples
project_angle.cpp, and project_pendulum.cpp.

Definition at line 44 of file Acc.cpp.

◆ z()

void Acc::z ( double &  v)

Read the accelerometer value on the z axis.

Parameters
vThe result is given by reference for speed
Examples
project_angle.cpp, and project_pendulum.cpp.

Definition at line 52 of file Acc.cpp.

Member Data Documentation

◆ scale

double myRIO::Acc::scale
private

Definition at line 24 of file Acc.h.


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