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

IR Receiver Sensor
[HiTechnic]

Files

file  hitechnic-irrecv.h
 

HiTechnic IR Receiver Sensor driver.


Defines

#define HTIRR_I2C_ADDR   0x02
#define HTIRR_OFFSET   0x42
#define HTIRR_MOTOR_1A   0x00
#define HTIRR_MOTOR_1B   0x01
#define HTIRR_MOTOR_2A   0x02
#define HTIRR_MOTOR_2B   0x03
#define HTIRR_MOTOR_3A   0x04
#define HTIRR_MOTOR_3B   0x05
#define HTIRR_MOTOR_4A   0x06
#define HTIRR_MOTOR_4B   0x07
#define MOTOR_BRAKE   -128

Functions

bool HTIRRreadChannel (tSensors link, byte channel, sbyte &motA, sbyte &motB)
bool HTIRRreadAllChannels (tSensors link, tsByteArray &motorSpeeds)

Variables

tByteArray HTIRR_I2CRequest
tByteArray HTIRR_I2CReply

Detailed Description

HiTechnic IR Receiver Sensor


Define Documentation

#define HTIRR_I2C_ADDR   0x02

HTIRR I2C device address

Definition at line 42 of file hitechnic-irrecv.h.

#define HTIRR_MOTOR_1A   0x00

Color number

Definition at line 46 of file hitechnic-irrecv.h.

#define HTIRR_MOTOR_1B   0x01

Color number

Definition at line 47 of file hitechnic-irrecv.h.

#define HTIRR_MOTOR_2A   0x02

Color number

Definition at line 48 of file hitechnic-irrecv.h.

#define HTIRR_MOTOR_2B   0x03

Color number

Definition at line 49 of file hitechnic-irrecv.h.

#define HTIRR_MOTOR_3A   0x04

Color number

Definition at line 50 of file hitechnic-irrecv.h.

#define HTIRR_MOTOR_3B   0x05

Color number

Definition at line 51 of file hitechnic-irrecv.h.

#define HTIRR_MOTOR_4A   0x06

Color number

Definition at line 52 of file hitechnic-irrecv.h.

#define HTIRR_MOTOR_4B   0x07

Color number

Definition at line 53 of file hitechnic-irrecv.h.

#define HTIRR_OFFSET   0x42

Offset for data registers

Definition at line 43 of file hitechnic-irrecv.h.

#define MOTOR_BRAKE   -128

Some define. Motor brake

Definition at line 56 of file hitechnic-irrecv.h.


Function Documentation

bool HTIRRreadAllChannels ( tSensors  link,
tsByteArray motorSpeeds 
)

Get the speeds of the motors for all channels.

Parameters:
linkthe HTIRR port number
motorSpeedsthe speeds for all the motors (-100 to +100, -128 = brake)
Returns:
true if no error occured, false if it did

Definition at line 99 of file hitechnic-irrecv.h.

bool HTIRRreadChannel ( tSensors  link,
byte  channel,
sbyte &  motA,
sbyte &  motB 
)

Get the speeds of the motors for a given channel.

Parameters:
linkthe HTIRR port number
channelthe channel number (1 to 4)
motAthe speed for Motor A (-100 to +100, -128 = brake)
motBthe speed for Motor B (-100 to +100, -128 = brake)
Returns:
true if no error occured, false if it did
Examples:
hitechnic-irrecv-test1.c.

Definition at line 76 of file hitechnic-irrecv.h.


Variable Documentation

Array to hold I2C reply data

Definition at line 65 of file hitechnic-irrecv.h.

Array to hold I2C command data

Definition at line 64 of file hitechnic-irrecv.h.