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

IR Seeker V1
[HiTechnic]

Files

file  hitechnic-irseeker-v1.h
 

HiTechnic IR Seeker driver.


Defines

#define HTIRS_I2C_ADDR   0x02
#define HTIRS_OFFSET   0x42
#define HTIRS_DIR   0x00
#define HTIRS_SSTR1   0x01
#define HTIRS_SSTR2   0x02
#define HTIRS_SSTR3   0x03
#define HTIRS_SSTR4   0x04
#define HTIRS_SSTR5   0x05

Functions

int HTIRSreadDir (tSensors link)
bool HTIRSreadAllStrength (tSensors link, int &dcS1, int &dcS2, int &dcS3, int &dcS4, int &dcS5)
int HTIRSreadDir (tMUXSensor muxsensor)
bool HTIRSreadAllStrength (tMUXSensor muxsensor, int &dcS1, int &dcS2, int &dcS3, int &dcS4, int &dcS5)

Variables

tConfigParams HTIRS_config = {HTSMUX_CHAN_I2C, 7, 0x02, 0x42}
tByteArray HTIRS_I2CRequest
tByteArray HTIRS_I2CReply

Detailed Description

HiTechnic Color IR Seeker V1


Define Documentation

#define HTIRS_DIR   0x00

Address of Direction data

Definition at line 57 of file hitechnic-irseeker-v1.h.

#define HTIRS_I2C_ADDR   0x02

IR Seeker I2C device address

Definition at line 55 of file hitechnic-irseeker-v1.h.

#define HTIRS_OFFSET   0x42

Offset for data registers

Definition at line 56 of file hitechnic-irseeker-v1.h.

#define HTIRS_SSTR1   0x01

Address of Sensor 0 signal strength

Definition at line 58 of file hitechnic-irseeker-v1.h.

#define HTIRS_SSTR2   0x02

Address of Sensor 1 signal strength

Definition at line 59 of file hitechnic-irseeker-v1.h.

#define HTIRS_SSTR3   0x03

Address of Sensor 2 signal strength

Definition at line 60 of file hitechnic-irseeker-v1.h.

#define HTIRS_SSTR4   0x04

Address of Sensor 3 signal strength

Definition at line 61 of file hitechnic-irseeker-v1.h.

#define HTIRS_SSTR5   0x05

Address of Sensor 4 signal strength

Definition at line 62 of file hitechnic-irseeker-v1.h.


Function Documentation

bool HTIRSreadAllStrength ( tSensors  link,
int &  dcS1,
int &  dcS2,
int &  dcS3,
int &  dcS4,
int &  dcS5 
)

Read the value of the all of the internal sensors.

Parameters:
linkthe HTIRS port number
dcS1data from internal sensor nr 1
dcS2data from internal sensor nr 2
dcS3data from internal sensor nr 3
dcS4data from internal sensor nr 4
dcS5data from internal sensor nr 5
Returns:
true if no error occured, false if it did
Examples:
hitechnic-irseeker-v1-SMUX-test1.c, and hitechnic-irseeker-v1-test1.c.

Definition at line 126 of file hitechnic-irseeker-v1.h.

bool HTIRSreadAllStrength ( tMUXSensor  muxsensor,
int &  dcS1,
int &  dcS2,
int &  dcS3,
int &  dcS4,
int &  dcS5 
)

Read the value of the all of the internal sensors.

Parameters:
muxsensorthe SMUX sensor port number
dcS1data from internal sensor nr 1
dcS2data from internal sensor nr 2
dcS3data from internal sensor nr 3
dcS4data from internal sensor nr 4
dcS5data from internal sensor nr 5
Returns:
true if no error occured, false if it did

Definition at line 157 of file hitechnic-irseeker-v1.h.

int HTIRSreadDir ( tMUXSensor  muxsensor )

Read the value of the Direction data register and return it.

Parameters:
muxsensorthe SMUX sensor port number
Returns:
value of 0-9, the direction index of the detected IR signal or -1 if an error occurred.

Definition at line 102 of file hitechnic-irseeker-v1.h.

int HTIRSreadDir ( tSensors  link )

Read the value of the Direction data register and return it.

Parameters:
linkthe HTIRS port number
Returns:
value of 0-9, the direction index of the detected IR signal or -1 if an error occurred.
Examples:
hitechnic-irseeker-v1-SMUX-test1.c, and hitechnic-irseeker-v1-test1.c.

Definition at line 82 of file hitechnic-irseeker-v1.h.


Variable Documentation

tConfigParams HTIRS_config = {HTSMUX_CHAN_I2C, 7, 0x02, 0x42}

Array to hold SMUX config data for sensor

Definition at line 71 of file hitechnic-irseeker-v1.h.

Array to hold I2C reply data

Definition at line 75 of file hitechnic-irseeker-v1.h.

Array to hold I2C command data

Definition at line 74 of file hitechnic-irseeker-v1.h.