|
Files | |
file | hitechnic-irlink-rcx.h |
HiTechnic IR Link RCX Comms Driver. | |
Functions | |
bool | HTRCXsendHeader (tSensors link) |
void | HTRCXencode (tSensors link, tByteArray &iBuffer, tByteArray &oBuffer) |
bool | HTRCXreadResp (tSensors link, tByteArray &response) |
bool | HTRCXplaySound (tSensors link, unsigned byte sound) |
bool | HTRCXsendByte (tSensors link, unsigned byte data) |
bool | HTRCXsendWord (tSensors link, short data) |
bool | HTRCXmotorOn (tSensors link, unsigned byte _motor) |
bool | HTRCXmotorOff (tSensors link, unsigned byte _motor) |
bool | HTRCXmotorFwd (tSensors link, unsigned byte _motor) |
bool | HTRCXmotorRev (tSensors link, unsigned byte _motor) |
bool | HTRCXmotorPwr (tSensors link, unsigned byte _motor, unsigned byte power) |
Variables | |
tByteArray | HTRCXI2CRequest |
tByteArray | HTRCXI2CReply |
tByteArray | HTRCXIRMsg |
byte | HTRCXCmdToggle = 0 |
HiTechnic IR Link RCX Comms Driver
void HTRCXencode | ( | tSensors | link, |
tByteArray & | iBuffer, | ||
tByteArray & | oBuffer | ||
) |
This encodes the message into the standard RCX format with opcodes, data and their complements, followed by a checksum.
The output is an I2C message that can be sent to the IR Link.
This does NOT send the IR message header.
Note: this is an internal function and should be not be called directly.
link | the sensor port number |
iBuffer | the IR message that is to be sent by the IR Link to the RCX |
oBuffer | the I2C message to be sent to the IR Link |
Definition at line 99 of file hitechnic-irlink-rcx.h.
bool HTRCXmotorFwd | ( | tSensors | link, |
unsigned byte | _motor | ||
) |
Move the specified motor forward
NOTE: This does not currently work with the ROBOTC firmware on the RCX
link | the sensor port number |
_motor | the motor channel to move forward |
Definition at line 298 of file hitechnic-irlink-rcx.h.
bool HTRCXmotorOff | ( | tSensors | link, |
unsigned byte | _motor | ||
) |
Turn the specified motor off
NOTE: This does not currently work with the ROBOTC firmware on the RCX
link | the sensor port number |
_motor | the motor channel to turn off |
Definition at line 273 of file hitechnic-irlink-rcx.h.
bool HTRCXmotorOn | ( | tSensors | link, |
unsigned byte | _motor | ||
) |
Turn the specified motor on
NOTE: This does not currently work with the ROBOTC firmware on the RCX
link | the sensor port number |
_motor | the motor channel to turn on |
Definition at line 248 of file hitechnic-irlink-rcx.h.
bool HTRCXmotorPwr | ( | tSensors | link, |
unsigned byte | _motor, | ||
unsigned byte | power | ||
) |
Set the motor power.
NOTE: This does not currently work with the ROBOTC firmware on the RCX
link | the sensor port number |
_motor | the motor channel to change the power level of |
power | the amount of power to be applied to the motor |
Definition at line 349 of file hitechnic-irlink-rcx.h.
bool HTRCXmotorRev | ( | tSensors | link, |
unsigned byte | _motor | ||
) |
Move the specified motor reverse
NOTE: This does not currently work with the ROBOTC firmware on the RCX
link | the sensor port number |
_motor | the motor channel to move reverse |
Definition at line 323 of file hitechnic-irlink-rcx.h.
bool HTRCXplaySound | ( | tSensors | link, |
unsigned byte | sound | ||
) |
Tell the RCX to play a sound. Sounds are numbered 0-5
link | the sensor port number |
sound | the sound to play, numbered 0-6 |
Definition at line 178 of file hitechnic-irlink-rcx.h.
bool HTRCXreadResp | ( | tSensors | link, |
tByteArray & | response | ||
) |
Read a message sent by the RCX. You will need to poll frequently to check if a message has been sent. The number of bytes received is in the first element of the response array. If it is non-zero, a message was received.
link | the sensor port number |
response | the IR message that was received from the RCX |
Definition at line 143 of file hitechnic-irlink-rcx.h.
bool HTRCXsendByte | ( | tSensors | link, |
unsigned byte | data | ||
) |
Send a single byte message to the RCX
link | the sensor port number |
data | the data to be sent to the RCX |
Definition at line 202 of file hitechnic-irlink-rcx.h.
bool HTRCXsendHeader | ( | tSensors | link ) |
Sends the RCX IR message header with all the trimmings.
Note: this is an internal function and should be not be called directly.
link | the sensor port number |
Definition at line 70 of file hitechnic-irlink-rcx.h.
bool HTRCXsendWord | ( | tSensors | link, |
short | data | ||
) |
Send 2 bytes message to the RCX as a short.
NOTE: This only works with the ROBOTC firmware on the RCX
link | the sensor port number |
data | the data to be sent to the RCX |
Definition at line 224 of file hitechnic-irlink-rcx.h.
byte HTRCXCmdToggle = 0 |
Definition at line 47 of file hitechnic-irlink-rcx.h.
Definition at line 44 of file hitechnic-irlink-rcx.h.
Definition at line 43 of file hitechnic-irlink-rcx.h.
Definition at line 45 of file hitechnic-irlink-rcx.h.