Mindstorms 3rd Party ROBOTC Drivers RobotC
[Home] [Download] [Submit a bug/suggestion] [ROBOTC Forums] [Blog] [Support this project]
Files | Defines | Functions | Variables

dFlex Sensor
[Dexter Industries]

Files

file  dexterind-flex.h
 

ROBOTC Dexter Industries dFlex Sensor driver.


Defines

#define DFLEXDAT   "DFLEX.dat"

Functions

int DFLEXvalRaw (tSensors link)
int DFLEXvalNorm (tSensors link)
void DFLEXcalLow (tSensors link)
void DFLEXcalLow (int lowval)
void DFLEXcalHigh (tSensors link)
void DFLEXcalHigh (int highval)
void _DFLEXcheckSensor (tSensors link)
void _DFLEXwriteCalVals (int lowval, int highval)
void _DFLEXreadCalVals (int &lowval, int &highval)

Variables

int dflexlow = 0
int dflexhigh = 1023
bool DFLEX_calibrated = false

Detailed Description

Dexter Industries dFlex Sensor driver


Define Documentation

#define DFLEXDAT   "DFLEX.dat"

Datafile for dFlex Sensor calibration info

Definition at line 42 of file dexterind-flex.h.


Function Documentation

void _DFLEXcheckSensor ( tSensors  link )

Check if the sensor is set to raw and that it's been configured as a sensorAnalogInactive. If not, reconfigure the port.

Note: this is an internal function and should not be called directly

Parameters:
linkthe dFlex Sensor port number

Definition at line 153 of file dexterind-flex.h.

void _DFLEXreadCalVals ( int &  lowval,
int &  highval 
)

Read the low and high calibration values from a data file.

Note: this is an internal function and should not be called directly

Parameters:
lowvalthe low calibration value
highvalthe high calibration value

Definition at line 228 of file dexterind-flex.h.

void _DFLEXwriteCalVals ( int  lowval,
int  highval 
)

Write the low and high calibration values to a data file.

Note: this is an internal function and should not be called directly

Parameters:
lowvalthe low calibration value
highvalthe high calibration value

Definition at line 168 of file dexterind-flex.h.

void DFLEXcalHigh ( int  highval )

Calibrate the dFlex Sensor's high calibration value with the supplied value.

Parameters:
highvalthe sensor's high calibration value

Definition at line 140 of file dexterind-flex.h.

void DFLEXcalHigh ( tSensors  link )

Calibrate the dFlex Sensor's high calibration value with the current raw sensor reading.

Parameters:
linkthe dFlex Sensor port number
Examples:
dexterind-flex-test2.c.

Definition at line 128 of file dexterind-flex.h.

void DFLEXcalLow ( int  lowval )

Calibrate the dFlex Sensor's low calibration value with the supplied value.

Parameters:
lowvalthe sensor's low calibration value

Definition at line 118 of file dexterind-flex.h.

void DFLEXcalLow ( tSensors  link )

Calibrate the dFlex Sensor's low calibration value with the current raw sensor reading.

Parameters:
linkthe dFlex Sensor port number
Examples:
dexterind-flex-test2.c.

Definition at line 106 of file dexterind-flex.h.

int DFLEXvalNorm ( tSensors  link )

Read the normalised value of the dFlex Sensor, based on the low and high values.

Note: this is not a linear value

Parameters:
linkthe dFlex Sensor port number
Returns:
the normalised value (0-100)
Examples:
dexterind-flex-test1.c, and dexterind-flex-test2.c.

Definition at line 82 of file dexterind-flex.h.

int DFLEXvalRaw ( tSensors  link )

Read the raw value of the dFlex Sensor.

Parameters:
linkthe dFlex Sensor port number
Returns:
the raw value of the dFlex Sensor
Examples:
dexterind-flex-test1.c, and dexterind-flex-test2.c.

Definition at line 68 of file dexterind-flex.h.


Variable Documentation

bool DFLEX_calibrated = false

Has the sensor been calibrated yet

Definition at line 47 of file dexterind-flex.h.

int dflexhigh = 1023

High calibration value

Examples:
dexterind-flex-test2.c.

Definition at line 46 of file dexterind-flex.h.

int dflexlow = 0

Low calibration value

Examples:
dexterind-flex-test2.c.

Definition at line 45 of file dexterind-flex.h.