TRC Library for FTC (2011) 2011
TRC Library Code Project

C:/Users/Michael/Ftc/2011/code/trclib/accel.h File Reference

#include "..\HTDriversV1.6\drivers\HTAC-driver.h"

Go to the source code of this file.

Data Structures

struct  ACCEL

Defines

#define _ACCEL_H
#define MOD_ID   MOD_ACCEL
#define ACCELF_USER_MASK   0x00ff
#define ACCEL_COUNT_PER_G   200
#define ACCEL_NUM_CAL_SAMPLES   50
#define ACCEL_CAL_INTERVAL   10

Functions

void AccelCal (__out ACCEL &accel, __in int numSamples, __in int calInterval)
void AccelInit (__out ACCEL &accel, __in int sensorID, __in int accelFlags)
bool AccelGetX (__in ACCEL &accel, __out float &value)
bool AccelGetY (__in ACCEL &accel, __out float &value)
bool AccelGetZ (__in ACCEL &accel, __out float &value)
bool AccelGetAllAxes (__in ACCEL &accel, __out float &xValue, __out float &yValue, __out float &zValue)

Define Documentation

#define _ACCEL_H

Definition at line 17 of file accel.h.

#define ACCEL_CAL_INTERVAL   10

Definition at line 37 of file accel.h.

#define ACCEL_COUNT_PER_G   200

Definition at line 35 of file accel.h.

#define ACCEL_NUM_CAL_SAMPLES   50

Definition at line 36 of file accel.h.

#define ACCELF_USER_MASK   0x00ff

Definition at line 31 of file accel.h.

#define MOD_ID   MOD_ACCEL

Definition at line 26 of file accel.h.


Function Documentation

void AccelCal ( __out ACCEL accel,
__in int  numSamples,
__in int  calInterval 
)

This function calibrates the accelerometer for zero offsets and deadband on all axes.

Parameters:
accelPoints to the ACCEL structure to be initialized.
numSamplesSpecifies the number of calibration samples.
calIntervalSpecifies the calibration interval in msec.

Definition at line 63 of file accel.h.

bool AccelGetAllAxes ( __in ACCEL accel,
__out float &  xValue,
__out float &  yValue,
__out float &  zValue 
)

This function gets the current values of the accelerometer on all axes in unit G.

Parameters:
accelPoints to the ACCEL structure.
xValueReturns the X value in G.
yValueReturns the Y value in G.
zValueReturns the Z value in G.
Returns:
Returns true if no error, false otherwise.

Definition at line 299 of file accel.h.

bool AccelGetX ( __in ACCEL accel,
__out float &  value 
)

This function gets the current value of the accelerometer X-axis in unit G.

Parameters:
accelPoints to the ACCEL structure.
valueReturns the value in G.
Returns:
Returns true if no error, false otherwise.

Definition at line 179 of file accel.h.

bool AccelGetY ( __in ACCEL accel,
__out float &  value 
)

This function gets the current value of the accelerometer Y-axis in unit G.

Parameters:
accelPoints to the ACCEL structure.
valueReturns the value in G.
Returns:
Returns true if no error, false otherwise.

Definition at line 218 of file accel.h.

bool AccelGetZ ( __in ACCEL accel,
__out float &  value 
)

This function gets the current value of the accelerometer Z-axis in unit G.

Parameters:
accelPoints to the ACCEL structure.
valueReturns the value in G.
Returns:
Returns true if no error, false otherwise.

Definition at line 257 of file accel.h.

void AccelInit ( __out ACCEL accel,
__in int  sensorID,
__in int  accelFlags 
)

This function initializes the accelerometer sensor.

Parameters:
accelPoints to the ACCEL structure to be initialized.
sensorIDSpecifies the ID of the accelerometer sensor.
accelFlagsSpecifies the accelerometer flags.

Definition at line 152 of file accel.h.

 All Data Structures Files Functions Variables Defines