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  hitechnic-magfield.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:
hitechnic-magfield-SMUX-test1.c, and hitechnic-magfield-test1.c.

Definition at line 196 of file hitechnic-magfield.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 207 of file hitechnic-magfield.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 94 of file hitechnic-magfield.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 111 of file hitechnic-magfield.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:
hitechnic-magfield-SMUX-test1.c, and hitechnic-magfield-test1.c.

Definition at line 66 of file hitechnic-magfield.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 83 of file hitechnic-magfield.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 174 of file hitechnic-magfield.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 185 of file hitechnic-magfield.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:
hitechnic-magfield-SMUX-test1.c, and hitechnic-magfield-test1.c.

Definition at line 122 of file hitechnic-magfield.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 151 of file hitechnic-magfield.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 56 of file hitechnic-magfield.h.