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

Magnetic Field Sensor
[HiTechnic]

Files

file  HTMAG-driver.h
 

HiTechnic Magnetic Field Sensor driver.


Functions

int HTMAGreadVal (tSensors link)
int HTMAGreadRaw (tSensors link)
int HTMAGstartCal (tSensors link)
int HTMAGreadCal (tSensors link)
void HTMAGsetCal (tSensors link, int bias)
int HTMAGreadVal (tMUXSensor muxsensor)
int HTMAGreadRaw (tMUXSensor muxsensor)
int HTMAGstartCal (tMUXSensor muxsensor)
int HTMAGreadCal (tMUXSensor muxsensor)
void HTMAGsetCal (tMUXSensor muxsensor, int bias)

Variables

int HTMAG_bias [][]

Detailed Description

HiTechnic Magnetic Field Sensor


Function Documentation

int HTMAGreadCal ( tSensors  link )

Retrieve the current bias for the sensor

Parameters:
linkthe HTMAG port number
Returns:
the bias value for the sensor
Examples:
HTMAG-SMUX-test1.c, and HTMAG-test1.c.

Definition at line 195 of file HTMAG-driver.h.

int HTMAGreadCal ( tMUXSensor  muxsensor )

Retrieve the current bias for the sensor

Parameters:
muxsensorthe SMUX sensor port number
Returns:
the bias value for the sensor

Definition at line 206 of file HTMAG-driver.h.

int HTMAGreadRaw ( tSensors  link )

Read the raw value of the Magnetic Field Sensor

Parameters:
linkthe HTMAG port number
Returns:
the value of the Magnetic Field Sensor (approx 300 to 700)

Definition at line 93 of file HTMAG-driver.h.

int HTMAGreadRaw ( tMUXSensor  muxsensor )

Read the raw value of the Magnetic Field Sensor

Parameters:
muxsensorthe SMUX sensor port number
Returns:
the value of the Magnetic Field Sensor (approx 300 to 700)

Definition at line 110 of file HTMAG-driver.h.

int HTMAGreadVal ( tSensors  link )

Read the value of the Magnetic Field Sensor

Parameters:
linkthe HTMAG port number
Returns:
the value of the Magnetic Field Sensor (-200 to +200)
Examples:
HTMAG-SMUX-test1.c, and HTMAG-test1.c.

Definition at line 65 of file HTMAG-driver.h.

int HTMAGreadVal ( tMUXSensor  muxsensor )

Read the value of the Magnetic Field Sensor

Parameters:
muxsensorthe SMUX sensor port number
Returns:
the value of the Magnetic Field Sensor (-200 to +200)

Definition at line 82 of file HTMAG-driver.h.

void HTMAGsetCal ( tSensors  link,
int  bias 
)

Override the current bias for the sensor manually

Parameters:
linkthe HTMAG port number
biasthe new bias to be used

Definition at line 173 of file HTMAG-driver.h.

void HTMAGsetCal ( tMUXSensor  muxsensor,
int  bias 
)

Override the current bias for the sensor manually

Parameters:
muxsensorthe SMUX sensor port number
biasthe new bias to be used

Definition at line 184 of file HTMAG-driver.h.

int HTMAGstartCal ( tSensors  link )

Calibrate the sensor by calculating the average bias of 5 raw readings.

Parameters:
linkthe HTMAG port number
Returns:
the new bias value for the sensor
Examples:
HTMAG-SMUX-test1.c, and HTMAG-test1.c.

Definition at line 121 of file HTMAG-driver.h.

int HTMAGstartCal ( tMUXSensor  muxsensor )

Calibrate the Magnetic Field Sensor by calculating the average bias of 5 raw readings.

Parameters:
muxsensorthe SMUX sensor port number
Returns:
the new bias value for the Magnetic Field Sensor

Definition at line 150 of file HTMAG-driver.h.


Variable Documentation

int HTMAG_bias[][]
Initial value:
 {{512, 512, 512, 512}, 
                          {512, 512, 512, 512},
                          {512, 512, 512, 512},
                          {512, 512, 512, 512}}

Definition at line 55 of file HTMAG-driver.h.