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

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

Go to the source code of this file.

Data Structures

struct  SENSOR


#define _SENSOR_H
#define SENSORZONE_LO   0
#define SENSORZONE_MID   1
#define SENSORZONE_HI   2
#define NUM_SENSOR_ZONES   3
#define SENSORF_USER_MASK   0x00ff
#define SENSORF_ENABLE_EVENTS   0x0001
#define SENSORF_INVERSE   0x0002
#define SENSORF_CALIBRATING   0x0100
#define SensorCalibrating(s)   (s.sensorFlags & SENSORF_CALIBRATING)


void SensorEvent (__in SENSOR &sensor)
void SensorInit (__out SENSOR &sensor, __in int sensorID, __in int lowThreshold, __in int highThreshold, __in int sensorFlags)
void SensorCal (__inout SENSOR &sensor, __in bool fStart)
void SensorTask (__inout SENSOR &sensor)

Define Documentation

#define _SENSOR_H

Definition at line 16 of file sensor.h.


Definition at line 23 of file sensor.h.

#define NUM_SENSOR_ZONES   3

Definition at line 31 of file sensor.h.

#define SensorCalibrating (   s)    (s.sensorFlags & SENSORF_CALIBRATING)

Definition at line 41 of file sensor.h.

#define SENSORF_CALIBRATING   0x0100

Definition at line 39 of file sensor.h.

#define SENSORF_ENABLE_EVENTS   0x0001

Definition at line 34 of file sensor.h.

#define SENSORF_INVERSE   0x0002

Definition at line 35 of file sensor.h.

#define SENSORF_USER_MASK   0x00ff

Definition at line 33 of file sensor.h.

#define SENSORZONE_HI   2

Definition at line 30 of file sensor.h.

#define SENSORZONE_LO   0

Definition at line 28 of file sensor.h.

#define SENSORZONE_MID   1

Definition at line 29 of file sensor.h.

Function Documentation

void SensorCal ( __inout SENSOR sensor,
__in bool  fStart 

This function starts or stops the sensor calibration process.

sensorPoints to the SENSOR structure.
fStartSpecifies whether to start or stop the calibration.

Definition at line 106 of file sensor.h.

void SensorEvent ( __in SENSOR sensor)
void SensorInit ( __out SENSOR sensor,
__in int  sensorID,
__in int  lowThreshold,
__in int  highThreshold,
__in int  sensorFlags 

This function initializes the sensor system.

sensorPoints to the SENSOR structure to be initialized.
sensorIDSpecifies the sensor ID.
lowThresholdSpecifies the low threshold value.
highThresholdSpecifies the high threshold value.
sensorFlagsSpecifies the sensor flags.

Definition at line 76 of file sensor.h.

void SensorTask ( __inout SENSOR sensor)

This function processes the sensor reading and sends a trigger event if necessary.

sensorPoints to the SENSOR structure.

Definition at line 143 of file sensor.h.

 All Data Structures Files Functions Variables Defines