Professional Documents
Culture Documents
Version
14-May-09 10:56:00
i
ii
Table of Contents
Data Structure Index ............................................................................................................................................... 1
File Index ............................................................................................................................................................... 1
Data Structure Documentation ................................................................................................................................ 2
blob .................................................................................................................................................................... 3
tByteArray ......................................................................................................................................................... 4
tIntArray ............................................................................................................................................................ 4
File Documentation ................................................................................................................................................ 6
common.h .......................................................................................................................................................... 7
HTAC-driver.h ................................................................................................................................................. 10
HTCS-driver.h.................................................................................................................................................. 13
HTDIR-driver.h ................................................................................................................................................ 17
HTEOPD-driver.h ............................................................................................................................................ 22
HTGYRO-driver.h............................................................................................................................................ 25
HTIRL-driver.h ................................................................................................................................................ 27
HTIRS-driver.h ................................................................................................................................................ 31
HTMC-driver.h ................................................................................................................................................ 34
HTPB-driver.h.................................................................................................................................................. 37
HTTMUX-driver.h ........................................................................................................................................... 40
MAX127-driver.h ............................................................................................................................................. 42
MCP23008-driver.h .......................................................................................................................................... 44
NXTCAM-driver.h ........................................................................................................................................... 48
Example Documentation....................................................................................................................................... 52
Index.................................................................................................................................................................... 70
iii
Data Structure Index
Data Structures
Here are the data structures with brief descriptions:
blob ................................................................................................................................................3
tByteArray .....................................................................................................................................4
tIntArray .......................................................................................................................................4
File Index
File List
Here is a list of all files with brief descriptions:
common.h (Commonly used functions used by drivers ) ................................................................7
HTAC-driver.h (HiTechnic Acceleration Sensor driver ) ............................................................ 10
HTCS-driver.h (HiTechnic Color Sensor driver ) ........................................................................ 13
HTDIR-driver.h (HiTechnic IR Seeker V2 driver ) ..................................................................... 17
HTEOPD-driver.h (HiTechnic EOPD Sensor driver ) ................................................................. 22
HTGYRO-driver.h (HiTechnic Gyroscopic Sensor driver ) ........................................................ 25
HTIRL-driver.h (HiTechnic IR Link Sensor driver ) .................................................................. 27
HTIRS-driver.h (HiTechnic IR Seeker driver ) ........................................................................... 31
HTMC-driver.h (HiTechnic Magnetic Compass Sensor Driver ) ................................................ 34
HTPB-driver.h (HiTechnic Prototype Board driver ) .................................................................. 37
HTTMUX-driver.h (HiTechnic Touch Multiplexer Sensor driver ) ............................................ 40
MAX127-driver.h (MAXIM MAX127 ADC driver ) ................................................................... 42
MCP23008-driver.h (MAXIM MCP23008 driver ) ...................................................................... 44
NXTCAM-driver.h (Mindsensors NXTCam driver ) ................................................................... 48
1
Data Structure Documentation
2
blob Struct Reference
#include <NXTCAM-driver.h>
Data Fields
int x1
int y1
int x2
int y2
int colour
int size
Detailed Description
Blob struct, contains all the data for a blob.
Field Documentation
int colour
Blob colour
int size
Blob size
int x1
left
int x2
right
int y1
top
int y2
bottom
The documentation for this struct was generated from the following file:
NXTCAM-driver.h
3
tByteArray Struct Reference
#include <common.h>
Data Fields
byte arr [MAX_ARR_SIZE]
int stupid_work_around_for_array_bug
Detailed Description
Array of bytes as a struct, this is a work around for RobotC's inability to pass an array to a function. The
int has to be there or it won't work.
Field Documentation
byte arr[MAX_ARR_SIZE]
int stupid_work_around_for_array_bug
The documentation for this struct was generated from the following file:
common.h
Data Fields
int arr [MAX_ARR_SIZE]
byte arrays_in_robotc_are_bugged_as_hell
Detailed Description
Array of ints as a struct, this is a work around for RobotC's inability to pass an array to a function. The
byte has to be there or it won't work.
Examples:
Field Documentation
int arr[MAX_ARR_SIZE]
4
Examples:
The documentation for this struct was generated from the following file:
common.h
5
File Documentation
6
common.h File Reference
Commonly used functions used by drivers.
#include "firmwareVersion.h"
Data Structures
struct tByteArray
struct tIntArray
Defines
#define MAX_ARR_SIZE 17
Functions
void clearI2CBus (tSensors link)
bool waitForI2CBus (tSensors link)
bool writeI2C (tSensors link, tByteArray &data, int replylen)
bool readI2C (tSensors link, tByteArray &data, int replylen)
int min (int x1, int x2)
int max (int x1, int x2)
int ubyteToInt (ubyte byteVal)
Detailed Description
Commonly used functions used by drivers.
common.h provides a number of frequently used functions that are useful for writing drivers. License:
You may use this code as you wish, provided you give credit where its due. THIS CODE WILL ONLY
WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
Changelog:
0.1: Initial release
0.2: Added version check to issue error when compiling with RobotC < 1.46
0.2: Added __COMMON_H_DEBUG__ to enable/disable sounds when an I2C error occurs
0.2: Removed bool waitForI2CBus(tSensors link, bool silent)
Author:
Xander Soldaat (mightor_at_gmail.com)
Date:
07 March 2009
Version:
0.2
Define Documentation
#define MAX_ARR_SIZE 17
Maximum buffer size for byte_array, can be overridden in your own program. It's 17 bytes big
because the max I2C buffer size is 16, plus 1 byte to denote packet length.
7
Function Documentation
8
Parameters:
link the port number
Returns:
true if no error occured, false if it did
9
HTAC-driver.h File Reference
HiTechnic Acceleration Sensor driver.
#include "common.h"
Defines
#define HTAC_I2C_ADDR 0x02
#define HTAC_X_UP 0x42
#define HTAC_Y_UP 0x43
#define HTAC_Z_UP 0x4C
#define HTAC_X_LOW 0x4D
#define HTAC_Y_LOW 0x4E
#define HTAC_Z_LOW 0x4F
Functions
bool HTACreadAllAxes (tSensors link, tIntArray &data)
int HTACreadX (tSensors link)
int HTACreadY (tSensors link)
int HTACreadZ (tSensors link)
Variables
tByteArray HTAC_I2CRequest
tByteArray HTAC_I2CReply
Detailed Description
HiTechnic Acceleration Sensor driver.
HTAC-driver.h provides an API for the HiTechnic Acceleration Sensor.
Changelog:
0.1: Initial release
Credits:
Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
License: You may use this code as you wish, provided you give credit where its due.
THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
Author:
Xander Soldaat (mightor_at_gmail.com)
Date:
14 March 2009
Version:
0.1
10
Define Documentation
Function Documentation
11
HTAC-test1.c.int HTACreadY (tSensors link)
Read the value of the Y axis register and return it.
Parameters:
link the HTIRS port number
Returns:
value of Y axis or -1 if an error occurred.
Examples:
Variable Documentation
tByteArray HTAC_I2CReply
Array to hold I2C reply data
tByteArray HTAC_I2CRequest
Array to hold I2C command data
12
HTCS-driver.h File Reference
HiTechnic Color Sensor driver.
#include "common.h"
Defines
#define HTCS_I2C_ADDR 0x02
#define HTCS_CMD_REG 0x41
#define HTCS_COLNUM_REG 0x42
#define HTCS_RED_REG 0x43
#define HTCS_GREEN_REG 0x44
#define HTCS_BLUE_REG 0x45
#define HTCS_RED_RAW_REG 0x46
#define HTCS_GREEN_RAW_REG 0x48
#define HTCS_BLUE_RAW_REG 0x4A
#define HTSC_COL_INDEX_REG 0x4C
#define HTSC_RED_NORM_REG 0x4D
#define HTSC_GREEN_NORM_REG 0x4E
#define HTSC_BLUE_NORM_REG 0x4F
#define HTCS_CAL_WHITE 0x43
Functions
int HTCSreadColor (tSensors link)
bool HTCSreadRGB (tSensors link, tIntArray &rgbvals)
bool HTCSreadNormRGB (tSensors link, tIntArray &normrgbvals)
bool HTCSreadRawRGB (tSensors link, tIntArray &rawrgbvals)
bool HTCScalWhite (tSensors link)
int HTCSreadColorIndex (tSensors link)
Variables
tByteArray HTCS_I2CRequest
tByteArray HTCS_I2CReply
Detailed Description
HiTechnic Color Sensor driver.
HTCS-driver.h provides an API for the HiTechnic Color Sensor driver.
Changelog:
0.1: Initial release
Credits:
Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
License: You may use this code as you wish, provided you give credit where its due.
THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
Author:
Xander Soldaat (mightor_at_gmail.com)
Date:
08 March 2009
13
Version:
0.1
Define Documentation
14
#define HTSC_RED_NORM_REG 0x4D
Normalised red reading
Function Documentation
15
Parameters:
link the HTCS port number
rawrgbvals int_array to hold the raw RGB values
Returns:
true if no error occured, false if it did
Examples:
Variable Documentation
tByteArray HTCS_I2CReply
Array to hold I2C reply data
tByteArray HTCS_I2CRequest
Array to hold I2C command data
16
HTDIR-driver.h File Reference
HiTechnic IR Seeker V2 driver.
#include "common.h"
Defines
#define HTDIR_I2C_ADDR 0x10
#define HTDIR_DSP_MODE 0x41
#define HTDIR_DC_DIR 0x42
#define HTDIR_DC_SSTR1 0x43
#define HTDIR_DC_SSTR2 0x44
#define HTDIR_DC_SSTR3 0x45
#define HTDIR_DC_SSTR4 0x46
#define HTDIR_DC_SSTR5 0x47
#define HTDIR_DC_SAVG 0x48
#define HTDIR_AC_DIR 0x49
#define HTDIR_AC_SSTR1 0x4A
#define HTDIR_AC_SSTR2 0x4B
#define HTDIR_AC_SSTR3 0x4C
#define HTDIR_AC_SSTR4 0x4D
#define HTDIR_AC_SSTR5 0x4E
Enumerations
enum tHTDIRDSPMode { DSP_1200 = 0, DSP_600 = 1 }
Functions
int HTDIRreadDCDir (tSensors link)
int HTDIRreadDCStrength (tSensors link, byte sensorNr)
int HTDIRreadAllDCStrength (tSensors link, tIntArray &oBuffer)
int HTDIRreadDCAverage (tSensors link)
bool HTDIRsetDSPMode (tSensors link, tHTDIRDSPMode mode)
int HTDIRreadACDir (tSensors link)
int HTDIRreadACStrength (tSensors link, byte sensorNr)
int HTDIRreadAllACStrength (tSensors link, tIntArray &oBuffer)
Variables
tByteArray HTDIR_I2CRequest
tByteArray HTDIR_I2CReply
Detailed Description
HiTechnic IR Seeker V2 driver.
HTDIR-driver.h provides an API for the HiTechnic IR Seeker V2.
Changelog:
0.1: Initial release
Credits:
Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
License: You may use this code as you wish, provided you give credit where its due.
17
THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
Author:
Xander Soldaat (mightor_at_gmail.com)
Date:
15 March 2009
Version:
0.1
Define Documentation
18
#define HTDIR_DC_SSTR4 0x46
DC Sensor 3 signal strength above average
enum tHTDIRDSPMode
Enumerator:
DSP_1200
DSP_600
Function Documentation
19
Returns:
0 when no errors occured, -1 when an error occurred.
Examples:
20
Variable Documentation
tByteArray HTDIR_I2CReply
Array to hold I2C reply data
tByteArray HTDIR_I2CRequest
Array to hold I2C command data
21
HTEOPD-driver.h File Reference
HiTechnic EOPD Sensor driver.
Enumerations
enum eHTEOPDsensorRange { HTEOPD_ILLEGAL_RANGE = -1, HTEOPD_SHORT_RANGE = 0,
HTEOPD_LONG_RANGE = 1 }
Functions
int HTEOPDgetRaw (tSensors link)
int HTEOPDgetProcessed (tSensors link)
void HTEOPDsetRange (tSensors link, eHTEOPDsensorRange range)
void HTEOPDsetShortRange (tSensors link)
void HTEOPDsetLongRange (tSensors link)
eHTEOPDsensorRange HTEOPDgetRange (tSensors link)
Detailed Description
HiTechnic EOPD Sensor driver.
HTEOPD-driver.h provides an API for the HiTechnic EOPD sensor.
Changelog:
0.1: Initial release
Credits:
Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
License: You may use this code as you wish, provided you give credit where its due.
THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
Author:
Xander Soldaat (mightor_at_gmail.com)
Date:
14 March 2009
Version:
0.1
enum eHTEOPDsensorRange
This enum is used to configure or determine the range of the sensor
Enumerator:
HTEOPD_ILLEGAL_RANGE Range is not legal
HTEOPD_SHORT_RANGE Short range
HTEOPD_LONG_RANGE Long range
22
Function Documentation
23
HTEOPD-test1.c.
24
HTGYRO-driver.h File Reference
HiTechnic Gyroscopic Sensor driver.
Functions
int HTGYROreadRot (tSensors link)
int HTGYROcalibrate (tSensors link)
int HTGYROgetCalibration (tSensors link)
void HTGYROsetCalibration (tSensors link, int offset)
Variables
int HTGYRO_offsets [] = {620, 620, 620, 620}
Detailed Description
HiTechnic Gyroscopic Sensor driver.
HTGYRO-driver.h provides an API for the HiTechnic Gyroscopic Sensor.
Changelog:
0.1: Initial release
Credits:
Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
License: You may use this code as you wish, provided you give credit where its due.
THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
Author:
Xander Soldaat (mightor_at_gmail.com)
Date:
14 March 2009
Version:
0.1
Function Documentation
25
Parameters:
link the HTAC port number
Returns:
the offset value for the gyro
Examples:
Variable Documentation
26
HTIRL-driver.h File Reference
HiTechnic IR Link Sensor driver.
#include "common.h"
Defines
#define BUF_HEADSIZE 3
#define BUF_DATASIZE 11
#define BUF_TAILSIZE 3
#define START_HEAD 0
#define START_DATA 3
#define START_TAIL 15
Enumerations
enum eCPMMotorCommand { CPM_MOTOR_FLOAT = 0, CPM_MOTOR_FWD_PWM_1 = 1,
CPM_MOTOR_FWD_PWM_2 = 2, CPM_MOTOR_FWD_PWM_3 = 3, CPM_MOTOR_FWD_PWM_4 =
4, CPM_MOTOR_FWD_PWM_5 = 5, CPM_MOTOR_FWD_PWM_6 = 6, CPM_MOTOR_FWD_PWM_7
= 7, CPM_MOTOR_BRAKE = 8, CPM_MOTOR_BAK_PWM_7 = 9, CPM_MOTOR_BAK_PWM_6 =
10, CPM_MOTOR_BAK_PWM_5 = 11, CPM_MOTOR_BAK_PWM_4 = 12,
CPM_MOTOR_BAK_PWM_3 = 13, CPM_MOTOR_BAK_PWM_2 = 14, CPM_MOTOR_BAK_PWM_1
= 15 }
enum eCDMMotorCommand { CDM_MOTOR_FLOAT = 0, CDM_MOTOR_FWD = 1,
CDM_MOTOR_BAK = 2, CDM_MOTOR_BRAKE = 3 }
Functions
void addI2CHead (tByteArray &data)
void addI2CTail (tByteArray &data)
void PFcomboDirectMode (tSensors link, int channel, eCDMMotorCommand _motorB, eCDMMotorCommand
_motorA)
void PFcomboPwmMode (tSensors link, int channel, eCPMMotorCommand _motorB, eCPMMotorCommand
_motorA)
void encodeBuffer (tByteArray &iBuffer, tByteArray &oBuffer)
void transmitIR (tSensors link, tByteArray &oBuffer, int channel, int resend)
Detailed Description
HiTechnic IR Link Sensor driver.
HTIRL-driver.h provides an API for the HiTechnic IR Link Sensor. Currently only the Power Functions
API has been implemented.
Changelog:
1.0: Initial release
1.1: Minor changes
1.2: Rewrite to make use of the new common.h API
Credits:
Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
License: You may use this code as you wish, provided you give credit where its due.
THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
27
Author:
Xander Soldaat (mightor_at_gmail.com)
Date:
14 March 2009
Version:
1.2
Define Documentation
#define BUF_DATASIZE 11
max size of encoded buffer
#define BUF_HEADSIZE 3
I2C buff size, address and register
#define BUF_TAILSIZE 3
IR data length, IR Link mode and start transmission
#define START_DATA 3
index of start of data payload
#define START_HEAD 0
index of start of header
#define START_TAIL 15
index of start of tail Combo PWM Mode commands
enum eCDMMotorCommand
Enumerator:
CDM_MOTOR_FLOAT Float the motor
CDM_MOTOR_FWD Forward
CDM_MOTOR_BAK Reverse
CDM_MOTOR_BRAKE Brake the motor
enum eCPMMotorCommand
Enumerator:
CPM_MOTOR_FLOAT Float the motor
CPM_MOTOR_FWD_PWM_1 Forward speed 1
28
CPM_MOTOR_FWD_PWM_2 Forward speed 2
CPM_MOTOR_FWD_PWM_3 Forward speed 3
CPM_MOTOR_FWD_PWM_4 Forward speed 4
CPM_MOTOR_FWD_PWM_5 Forward speed 5
CPM_MOTOR_FWD_PWM_6 Forward speed 6
CPM_MOTOR_FWD_PWM_7 Forward speed 7
CPM_MOTOR_BRAKE Brake the motor
CPM_MOTOR_BAK_PWM_7 Reverse speed 7
CPM_MOTOR_BAK_PWM_6 Reverse speed 6
CPM_MOTOR_BAK_PWM_5 Reverse speed 5
CPM_MOTOR_BAK_PWM_4 Reverse speed 4
CPM_MOTOR_BAK_PWM_3 Reverse speed 3
CPM_MOTOR_BAK_PWM_2 Reverse speed 2
CPM_MOTOR_BAK_PWM_1 Reverse speed 1
Function Documentation
29
Parameters:
link the sensor port number
channel the channel of the receiver we wish to communicate with.
_motorB the command to be sent to Motor B
_motorA the command to be sent to Motor A
Examples:
HTIRL-test1.c.void transmitIR (tSensors link, tByteArray & oBuffer, int channel, int resend)
Send the command to the IRLink Sensor for transmission.
Note: this is an internal function and should not be called directly. If the driver is compiled with
__DEBUG_DRIVER__, this function will call debugIR() prior to transmitting the data for debugging
purposes.
Parameters:
link the sensor port number
oBuffer the data that is be transmitted
channel the channel number of the receiver
resend the number of times the command should be resent
30
HTIRS-driver.h File Reference
HiTechnic IR Seeker driver.
#include "common.h"
Defines
#define HTIRS_I2C_ADDR 0x02
#define HTIRS_DIR 0x42
#define HTIRS_SSTR1 0x43
#define HTIRS_SSTR2 0x4C
#define HTIRS_SSTR3 0x4D
#define HTIRS_SSTR4 0x4E
#define HTIRS_SSTR5 0x4F
Functions
int HTIRSreadDir (tSensors link)
int HTIRSreadStrength (tSensors link, byte sensorNr)
int HTIRSreadAllStrength (tSensors link, tIntArray &oBuffer)
Variables
tByteArray HTIRS_I2CRequest
tByteArray HTIRS_I2CReply
Detailed Description
HiTechnic IR Seeker driver.
HTIRS-driver.h provides an API for the HiTechnic IR Seeker.
Changelog:
0.1: Initial release
0.2: Changed comments on HTIRReadDir()
0.3: Reduced MAX_BUFSIZE to 5 to reduce overhead
0.4: Major rewrite of code, uses common.h for most functions
Credits:
Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
JamesD for testing and finding bugs.
License: You may use this code as you wish, provided you give credit where its due.
THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
Author:
Xander Soldaat (mightor_at_gmail.com)
Date:
07 March 2009
Version:
0.4
31
Define Documentation
Function Documentation
32
HTIRS-test1.c.int HTIRSreadStrength (tSensors link, byte sensorNr)
Read the value of the specified internal sensor, numbered 0-5 and return it.
Parameters:
link the HTIRS port number
sensorNr the internal sensor to read
Returns:
the signal strength value of the specified sensor or -1 if an error occurred.
Variable Documentation
tByteArray HTIRS_I2CReply
Array to hold I2C reply data
tByteArray HTIRS_I2CRequest
Array to hold I2C command data
33
HTMC-driver.h File Reference
HiTechnic Magnetic Compass Sensor Driver.
#include "common.h"
Defines
#define HTMC_I2C_ADDR 0x02
#define HTMC_MODE 0x41
#define HTMC_HEAD_U 0x42
#define HTMC_HEAD_L 0x43
#define HTMC_MEASURE_CMD 0x00
#define HTMC_CALIBRATE_CMD 0x043
Functions
bool HTMCstartCal (tSensors link)
bool HTMCstopCal (tSensors link)
int HTMCreadHeading (tSensors link)
int HTMCreadRelativeHeading (tSensors link)
int HTMCsetTarget (tSensors link)
int HTMCsetTarget (tSensors link, int offset)
Variables
tByteArray HTMC_I2CRequest
tByteArray HTMC_I2CReply
int target [4] = {0, 0, 0, 0}
Detailed Description
HiTechnic Magnetic Compass Sensor Driver.
HTMC-driver.h provides an API for the HiTechnic Magnetic Compass Sensor.
Changelog:
0.1: Initial release
License: You may use this code as you wish, provided you give credit where its due.
THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
Author:
Xander Soldaat (mightor_at_gmail.com)
Date:
27 May 2009
Version:
0.1
Define Documentation
34
#define HTMC_HEAD_L 0x43
HTMC Heading Lower bit
Function Documentation
35
Parameters:
link the HTMC port number
Examples:
Variable Documentation
tByteArray HTMC_I2CReply
Array to hold I2C reply data
tByteArray HTMC_I2CRequest
Array to hold I2C command data
36
HTPB-driver.h File Reference
HiTechnic Prototype Board driver.
#include "common.h"
Defines
#define HTPB_I2C_ADDR 0x02
#define HTPB_A0_U 0x42
#define HTPB_A0_L 0x43
#define HTPB_DIGIN 0x4C
#define HTPB_DIGOUT 0x4D
#define HTPB_DIGCTRL 0x4E
#define HTPB_SRATE 0x4F
Functions
byte HTPBReadIO (tSensors link, byte mask)
bool HTPBWriteIO (tSensors link, byte mask)
bool HTPBSetupIO (tSensors link, byte mask)
int HTPBReadADC (tSensors link, byte channel, byte width)
bool HTPBReadAllADC (tSensors link, tIntArray &channel_values, byte width)
bool HTPBSetSamplingTime (tSensors link, byte interval)
void _workAround (tSensors link)
Variables
tByteArray HTPB_I2CRequest
tByteArray HTPB_I2CReply
bool done_workaround [4] = { false, false, false, false}
Detailed Description
HiTechnic Prototype Board driver.
HTPB-driver.h provides an API for the HiTechnic Proto Board.
Changelog:
0.1: Initial release
0.2: Minor bug fixes
0.3: Major rewrite to make use of common.h for common API
License: You may use this code as you wish, provided you give credit where its due.
THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
Author:
Xander Soldaat (mightor_at_gmail.com)
Date:
07 March 2009
Version:
0.3
37
Define Documentation
Function Documentation
38
channel_values buffer for returned data from ADCs
width the bit width of the result, can be either 8 or 10
Returns:
true if no error occured, false if it did
Variable Documentation
tByteArray HTPB_I2CReply
Array to hold I2C reply data Keeps track for which link the workaround has been done
tByteArray HTPB_I2CRequest
Array to hold I2C command data
39
HTTMUX-driver.h File Reference
HiTechnic Touch Multiplexer Sensor driver.
Functions
int HTTMUXgetActive (tSensors link)
bool HTTMUXisActive (tSensors link, int touch)
Detailed Description
HiTechnic Touch Multiplexer Sensor driver.
HTTMUX-driver.h provides an API for the HiTechnic Touch Multiplexer Sensor.
Changelog:
0.1: Initial release
Credits:
Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
License: You may use this code as you wish, provided you give credit where its due.
THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
Author:
Xander Soldaat (mightor_at_gmail.com)
Date:
15 March 2009
Version:
0.1
Function Documentation
40
Returns:
the value of the switches status
Examples:
HTTMUX-test1.c.
41
MAX127-driver.h File Reference
MAXIM MAX127 ADC driver.
#include "common.h"
Defines
#define MAX127_I2C_ADDR 0x50
Functions
int MAX127readChan (tSensors link, byte i2caddress, byte adcchannel)
Variables
tByteArray MAX127_I2CRequest
tByteArray MAX127_I2CReply
Detailed Description
MAXIM MAX127 ADC driver.
HTIRS-driver.h provides an API for the MAXIM MAX127 ADC.
Changelog:
0.1: Initial release
0.5: Major rewrite of code, uses common.h for most functions
License: You may use this code as you wish, provided you give credit where its due.
THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
Author:
Xander Soldaat (mightor_at_gmail.com)
Date:
08 March 2009
Version:
0.5
Define Documentation
Function Documentation
42
Parameters:
link the MAX127 port number
i2caddress the I2C address the MAX127 is configured for. Use MAX127_I2C_ADDR for the default.
adcchannel the ADC channel number (0-7)
Returns:
value of the ADC channel or -1 if an error occurred.
Examples:
MAX127-test1.c.
Variable Documentation
tByteArray MAX127_I2CReply
Array to hold I2C reply data
tByteArray MAX127_I2CRequest
Array to hold I2C command data
43
MCP23008-driver.h File Reference
MAXIM MCP23008 driver.
#include "common.h"
Defines
#define MCP_REG_IODIR 0x00
#define MCP_REG_IPOL 0x01
#define MCP_REG_GPINTEN 0x02
#define MCP_REG_DEFVAL 0x03
#define MCP_REG_INTCON 0x04
#define MCP_REG_IOCON 0x05
#define MCP_REG_GPPU 0x06
#define MCP_REG_INTF 0x07
#define MCP_REG_INTCAP 0x08
#define MCP_REG_GPIO 0x09
#define MCP_REG_OLAT 0x0A
#define MCP_BIT_INTPOL 1
#define MCP_BIT_ODR 2
#define MCP_BIT_DISSLW 4
#define MCP_BIT_SREAD 5
#define MCP_I2C_ADDR 0x40
Functions
bool MCP23008SetupIO (tSensors link, byte addr, byte mask, byte pullup)
bool MCP23008SetupIO (tSensors link, byte addr, byte mask)
byte MCP23008ReadIO (tSensors link, byte addr, byte mask)
byte MCP23008ReadIO (tSensors link, byte addr)
bool MCP23008WriteIO (tSensors link, byte addr, byte mask)
bool MCP23008WriteReg (tSensors link, byte addr, byte reg, byte data)
byte MCP23008ReadReg (tSensors link, byte addr, byte reg)
Variables
tByteArray MCP23008_I2CRequest
tByteArray MCP23008_I2CReply
Detailed Description
MAXIM MCP23008 driver.
MCP23008-driver.h provides an API for the MCP23008 8 port IO expander.
Changelog:
0.3 Rewrite to make use of standard common.h framework.
License: You may use this code as you wish, provided you give credit where it's due.
THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
Author:
Xander Soldaat
44
Date:
14 March 2009
Version:
0.3
Define Documentation
#define MCP_BIT_DISSLW 4
Slew Rate control bit for SDA output
#define MCP_BIT_INTPOL 1
This bit sets the polarity of the INT output pin
#define MCP_BIT_ODR 2
This bit configures the INT pin as an open-drain output
#define MCP_BIT_SREAD 5
Sequential Operation mode bit
45
#define MCP_REG_IOCON 0x05
CONFIGURATION REGISTER
Function Documentation
46
Parameters:
link the sensor port number
addr the address of the MCP23008
mask the pins to change the configuration for
Returns:
true if no error occured, false if it did
bool MCP23008SetupIO (tSensors link, byte addr, byte mask, byte pullup)
Setup the pins as either inputs or outputs as specified by the mask. 0 is input, 1 is output
Parameters:
link the sensor port number
addr the address of the MCP23008
mask the pins to change the configuration for
pullup the pins to change the internal pullup resistor for
Returns:
true if no error occured, false if it did
bool MCP23008WriteReg (tSensors link, byte addr, byte reg, byte data)
Write data to the device at the specified register.
Note: this is an internal function and should not be called directly.
Parameters:
link the sensor port number
addr the address of the MCP23008
reg the register to write to
data the data to be written (single byte)
Returns:
true if no error occured, false if it did
Variable Documentation
tByteArray MCP23008_I2CReply
Array to hold I2C reply data
tByteArray MCP23008_I2CRequest
Array to hold I2C command data
47
NXTCAM-driver.h File Reference
Mindsensors NXTCam driver.
#include "common.h"
Data Structures
struct blob
Defines
#define MAX_BLOBS 8
#define NXTCAM_I2C_ADDR 0x02
#define NXTCAM_CMD_REG 0x41
#define NXTCAM_COUNT_REG 0x42
#define NXTCAM_DATA_REG 0x43
#define SIDE_CENTER(X1, X2) ((X1 + X2) / 2)
Typedefs
typedef blob blob_array [MAX_BLOBS]
Functions
bool NXTCAMinit (tSensors link)
int NXTCAMgetBlobs (tSensors link, blob_array &blobs, bool mergeBlobs)
int NXTCAMgetBlobs (tSensors link, blob_array &blobs)
bool _camera_cmd (tSensors link, byte cmd)
int _mergeBlobs (int blob1, int blob2, int nblobs, blob_array &blobs)
int _merge (int nblobs, blob_array &blobs)
void _sortBlobs (int nblobs, blob_array &blobs)
void NXTCAMgetAverageCenter (blob_array &blobs, int nblobs, int colourindex, int &x, int &y)
Variables
tByteArray NXTCAM_I2CRequest
tByteArray NXTCAM_I2CReply
bool still_merging
Detailed Description
Mindsensors NXTCam driver.
NXTCAM-driver.h provides an API for the Mindsensors NXTCam. This version is an extensive rewrite
of Gordon Wyeth's driver. The blob information is no longer kept in seperate array, but in an array of
structs.
Changelog:
1.0: Partial rewrite of original driver, using structs instead of arrays to hold blob info
1.1: Further rewrite to use common.h functions to further align with standard driver framework
License: You may use this code as you wish, provided you give credit where it's due.
THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
Author:
Xander Soldaat
48
Gordon Wyeth
Date:
08 March 2009
Version:
1.1
Define Documentation
#define MAX_BLOBS 8
Maximum number of blobs returned by the NXTCam
Typedef Documentation
Function Documentation
49
Returns:
true if no error occured, false if it did
int _mergeBlobs (int blob1, int blob2, int nblobs, blob_array & blobs)
Check if two blobs can be merged into one. blob1 will be replaced with the new merged blob and
blob2 will be destroyed.
Note: this is an internal function and should not be called directly.
Parameters:
blob1 the index number of the first blob
blob2 the index number of the second blob
nblobs the number of blobs
blobs the array of blobs
Returns:
the number of blobs detected
void NXTCAMgetAverageCenter (blob_array & blobs, int nblobs, int colourindex, int & x,
int & y)
Calculate the average center of all the blobs of a specific colour.
Note: this is an experimental function and may not function properly yet.
Parameters:
blobs the array of blobs
nblobs the number of blobs
colourindex the colour of the blobs of which the average center is to be calculated
x x-coordinate of the center
y y-coordinate of the center
50
blobs the array of blobs
Returns:
the number of blobs detected, -1 if an error occurred
Variable Documentation
tByteArray NXTCAM_I2CReply
Array to hold I2C reply data
tByteArray NXTCAM_I2CRequest
Array to hold I2C command data
bool still_merging
boolean to signal if there are still blobs that might qualify for merging
51
Example Documentation
HTAC-test1.c
/**
* HTAC-driver.h provides an API for the HiTechnic Acceleration Sensor. This program
* demonstrates how to use that API.
*
* Credits:
* - Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
*
* License: You may use this code as you wish, provided you give credit where it's due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
* Xander Soldaat (mightor_at_gmail.com)
* 08 March 2009
* version 0.1
*/
#include "drivers/common.h"
#include "drivers/HTAC-driver.h"
task main () {
int _x_axis = 0;
int _y_axis = 0;
int _z_axis = 0;
tIntArray _axes;
string _tmp;
while (true) {
eraseDisplay();
_x_axis = HTACreadX(HTAC);
_y_axis = HTACreadY(HTAC);
_z_axis = HTACreadZ(HTAC);
if (!HTACreadAllAxes(HTAC, _axes)) {
nxtDisplayTextLine(4, "ERROR!!");
wait1Msec(2000);
StopAllTasks();
}
52
nxtDisplayTextLine(7, "A: All at once");
wait1Msec(100);
}
}
53
HTCS-test1.c
/**
* HTCS-driver.h provides an API for the HiTechnic Color Sensor. This program
* demonstrates how to use that API.
*
* Credits:
* - Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
*
* License: You may use this code as you wish, provided you give credit where it's due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
* Xander Soldaat (mightor_at_gmail.com)
* 08 March 2009
* version 0.1
*/
#include "drivers/common.h"
#include "drivers/HTCS-driver.h"
task main () {
int _color = 0;
int _colorindex = 0;
string _tmp;
tIntArray _rawrgbvalues;
tIntArray _rgbvals;
tIntArray _normrgbvals;
while (true) {
eraseDisplay();
_color = HTCSreadColor(HTCS);
_colorindex = HTCSreadColorIndex(HTCS);
54
// We can't provide more than 2 parameters to nxtDisplayTextLine(),
// so we'll do in two steps using StringFormat()
nxtDisplayTextLine(3, "C RGB RAW NRM");
StringFormat(_tmp, "R:%4d %4d", _rgbvals.arr[0], _rawrgbvalues.arr[0]);
nxtDisplayTextLine(4, "%s %4d", _tmp, _normrgbvals.arr[0]);
wait1Msec(100);
}
}
55
HTCS-test2.c
/**
* HTCS-driver.h provides an API for the HiTechnic Color Sensor. This program
* demonstrates how to use that API. This program allows you to calibrate the white
* value for the Color Sensor.
*
* Credits:
* - Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
*
* License: You may use this code as you wish, provided you give credit where it's due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
* Xander Soldaat (mightor_at_gmail.com)
* 08 March 2009
* version 0.1
*/
#include "drivers/HTCS-driver.h"
task main () {
// Get control over the buttons
nNxtButtonTask = -2;
eraseDisplay();
nxtDisplayTextLine(0, "HTCS Test 2");
nxtDisplayTextLine(2, "Press orange");
nxtDisplayTextLine(3, "button to start");
nxtDisplayTextLine(4, "calibration.");
nxtDisplayTextLine(5, "Press grey");
nxtDisplayTextLine(6, "button to exit.");
while(nNxtButtonPressed != kEnterButton);
eraseDisplay();
nxtDisplayTextLine(3, "Starting");
nxtDisplayTextLine(4, "calibration.");
if (!HTCScalWhite(HTCS)) {
eraseDisplay();
PlaySound(soundException);
nxtDisplayTextLine(3, "ERROR!!");
nxtDisplayTextLine(5, "Calibration");
nxtDisplayTextLine(6, "failed!!");
wait1Msec(2000);
StopAllTasks();
}
wait1Msec(1000);
}
56
HTDIR-test1.c
/**
* HTDIR-driver.h provides an API for the HiTechnic IR Seeker V2. This program
* demonstrates how to use that API.
*
* Changelog:
* - 0.1: Initial release
*
* Credits:
* - Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
*
* License: You may use this code as you wish, provided you give credit where it's due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
* Xander Soldaat (mightor_at_gmail.com)
* 15 March 2009
* version 0.1
*/
#include "drivers/common.h"
#include "drivers/HTDIR-driver.h"
task main () {
int _dirDC;
int _dirAC;
tIntArray _sensorValsDC;
tIntArray _sensorValsAC;
tHTDIRDSPMode _mode;
while(true) {
// You can switch between the two different DSP modes by pressing the
// orange enter button
if (time1[T1] > 1000) {
if (_mode == DSP_1200) {
_mode = DSP_600;
HTDIRsetDSPMode(HTDIR, _mode);
} else {
_mode = DSP_1200;
HTDIRsetDSPMode(HTDIR, _mode);
}
PlaySound(soundBlip);
time1[T1] = 0;
}
while(nNxtButtonPressed != kEnterButton) {
eraseDisplay();
_dirDC = HTDIRreadDCDir(HTDIR);
_dirAC = HTDIRreadACDir(HTDIR);
HTDIRreadAllDCStrength(HTDIR, _sensorValsDC);
HTDIRreadAllACStrength(HTDIR, _sensorValsAC);
if (_mode == DSP_1200)
nxtDisplayTextLine(0, " DC 1200");
else
nxtDisplayTextLine(0, " DC 600");
57
nxtDisplayTextLine(1, "D: %4d %4d", _dirDC, _dirAC);
nxtDisplayTextLine(2, "0: %4d %4d", _sensorValsDC.arr[0], _sensorValsAC.arr[0]);
nxtDisplayTextLine(3, "1: %4d %4d", _sensorValsDC.arr[1], _sensorValsAC.arr[1]);
nxtDisplayTextLine(4, "2: %4d %4d", _sensorValsDC.arr[2], _sensorValsAC.arr[2]);
nxtDisplayTextLine(5, "3: %4d %4d", _sensorValsDC.arr[3], _sensorValsAC.arr[3]);
nxtDisplayTextLine(6, "4: %4d %4d", _sensorValsDC.arr[4], _sensorValsAC.arr[4]);
nxtDisplayTextLine(7, "Enter to switch");
wait1Msec(100);
}
}
}
58
HTEOPD-test1.c
/**
* HTCS-driver.h provides an API for the HiTechnic EOPD Sensor. This program
* demonstrates how to use that API.
*
* Credits:
* - Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
*
* License: You may use this code as you wish, provided you give credit where it's due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
* Xander Soldaat (mightor_at_gmail.com)
* 08 March 2009
* version 0.1
*/
#include "drivers/HTEOPD-driver.h"
/*
=============================================================================
main task with some testing code
*/
task main() {
int _raw = 0;
int _processed = 0;
nNxtButtonTask = -2;
eraseDisplay();
wait1Msec(2000);
eraseDisplay();
HTEOPDsetShortRange(HTEOPD);
while(true) {
if (time1[T1] > 1000) {
if (HTEOPDgetRange(HTEOPD) == HTEOPD_LONG_RANGE) {
HTEOPDsetShortRange(HTEOPD);
nxtDisplayClearTextLine(1);
nxtDisplayTextLine(1, "Short range");
} else {
HTEOPDsetLongRange(HTEOPD);
nxtDisplayClearTextLine(1);
nxtDisplayTextLine(1, "Long range");
}
PlaySound(soundBlip);
time1[T1] = 0;
}
while(nNxtButtonPressed != kEnterButton) {
_raw = HTEOPDgetRaw(HTEOPD);
_processed = HTEOPDgetProcessed(HTEOPD);
nxtDisplayClearTextLine(3);
nxtDisplayClearTextLine(4);
nxtDisplayTextLine(4, "Proc: %4d", _processed);
59
nxtDisplayTextLine(3, "Raw : %4d", _raw);
wait1Msec(100);
}
}
}
60
HTGYRO-test1.c
/**
* HTGYRO-driver.h provides an API for the HiTechnic Gyroscopic Sensor. This program
* demonstrates how to use that API.
*
* Credits:
* - Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
*
* License: You may use this code as you wish, provided you give credit where it's due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
* Xander Soldaat (mightor_at_gmail.com)
* 08 March 2009
* version 0.1
*/
#include "drivers/HTGYRO-driver.h"
task main () {
nxtDisplayTextLine(0, "HT Gyro");
nxtDisplayTextLine(1, "Test 1");
nxtDisplayTextLine(5, "Press enter");
nxtDisplayTextLine(6, "to set relative");
nxtDisplayTextLine(7, "heading");
wait1Msec(2000);
eraseDisplay();
time1[T1] = 0;
while(true) {
if (time1[T1] > 1000) {
eraseDisplay();
nxtDisplayTextLine(1, "Resetting");
nxtDisplayTextLine(1, "heading");
wait1Msec(500);
nxtDisplayTextLine(2, "Offset: %4d", HTGYROcalibrate(HTGYRO));
PlaySound(soundBlip);
while(bSoundActive);
time1[T1] = 0;
}
while(nNxtButtonPressed != kEnterButton) {
eraseDisplay();
nxtDisplayTextLine(1, "Reading");
nxtDisplayTextLine(2, "Offset: %4d", HTGYROgetCalibration(HTGYRO));
nxtDisplayClearTextLine(4);
nxtDisplayTextLine(4, "Gyro: %4d", HTGYROreadRot(HTGYRO));
nxtDisplayTextLine(6, "Press enter");
nxtDisplayTextLine(7, "to recalibrate");
wait1Msec(100);
}
}
}
61
HTIRL-test1.c
/**
* HTIRL-driver.h provides an API for the HiTechnic IR Link Sensor. This program
* demonstrates how to use the Power Functions API to control up to 8 motors.
*
* Credits:
* - Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
*
* License: You may use this code as you wish, provided you give credit where it's due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
* Xander Soldaat (mightor_at_gmail.com)
* 08 March 2009
* version 0.2
*/
#include "drivers/HTIRL-driver.h"
/*
=============================================================================
main task with some testing code
*/
task main {
int MotorA_cmd = 0;
int MotorB_cmd = 0;
PlaySound(soundDownwardTones);
while (bSoundActive) {}
62
HTIRS-test1.c
/**
* HTIRS-driver.h provides an API for the HiTechnic IR Seeker. This program
* demonstrates how to use that API.
*
* Credits:
* - Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
*
* License: You may use this code as you wish, provided you give credit where it's due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
* Xander Soldaat (mightor_at_gmail.com)
* 07 March 2009
* version 0.2
*/
#include "drivers/common.h"
#include "drivers/HTIRS-driver.h"
task main () {
int _dir = 0;
tIntArray _sensorData;
while(true) {
eraseDisplay();
63
HTMC-test1.c
/**
* HTMC-driver.h provides an API for the HiTechnic Compass Sensor. This program
* demonstrates how to use that API.
*
* License: You may use this code as you wish, provided you give credit where it's due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
* Xander Soldaat (mightor_at_gmail.com)
* 28 March 2009
* version 0.1
*/
#include "drivers/HTMC-driver.h"
task main () {
int _target = 0;
nxtDisplayTextLine(0, "HT Compass");
nxtDisplayTextLine(1, "Test 1");
nxtDisplayTextLine(5, "Press enter");
nxtDisplayTextLine(6, "to set target");
wait1Msec(2000);
eraseDisplay();
time1[T1] = 0;
while(true) {
if (time1[T1] > 1000) {
eraseDisplay();
nxtDisplayTextLine(1, "Changing");
nxtDisplayTextLine(2, "target");
wait1Msec(500);
_target = HTMCsetTarget(HTMC);
PlaySound(soundBlip);
while(bSoundActive);
time1[T1] = 0;
}
while(nNxtButtonPressed != kEnterButton) {
eraseDisplay();
nxtDisplayTextLine(1, "Reading");
nxtDisplayTextLine(2, "Target: %4d", _target);
nxtDisplayTextLine(4, "Abs: %4d", HTMCreadHeading(HTMC));
nxtDisplayTextLine(5, "Rel: %4d", HTMCreadRelativeHeading(HTMC));
nxtDisplayTextLine(6, "Press enter");
nxtDisplayTextLine(7, "to set target");
wait1Msec(100);
}
}
}
64
HTMC-test2.c
/**
* HTMC-driver.h provides an API for the HiTechnic Compass Sensor. This program
* demonstrates how to use that API to calibrate the compass.
*
* The code here is made to work with the standard NXT Tribot. You will need to edit
* the WHEELDIST, WHEELSIZE and MOTORSPEED figures to make it work with your robot.
*
* Remeber that the robot shouldn't spin more than 360 degrees per 20 seconds. Also
* make sure it spins a bit more than 360, perhaps 1 and 1/4 or 1 and 1/2.
*
* License: You may use this code as you wish, provided you give credit where it's due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
* Xander Soldaat (mightor_at_gmail.com)
* 04 April 2009
* version 0.1
*/
#include "drivers/HTMC-driver.h"
// Lets you know when 20 seconds is over, can help with setting up
// the initial timing and motor speed.
task timeMe() {
wait1Msec(20000);
PlaySound(soundBeepBeep);
while(bSoundActive);
}
// Does some voodoo maths to calculate how many times the wheels should rotate
// to make the robot spin about 360 degrees.
int numRotations() {
return ((WHEELDIST * 3142) / 1000) / ((WHEELSIZE * 3142) / 1000);
}
void startCalibration() {
if (!HTMCstartCal(HTCOMPASS_PORT)) {
eraseDisplay();
nxtDisplayTextLine(1, "ERROR: Couldn't");
nxtDisplayTextLine(2, "calibrate sensor.");
nxtDisplayTextLine(4, "Check connection");
nxtDisplayTextLine(5, "and try again.");
PlaySound(soundException);
while(bSoundActive);
wait1Msec(5000);
StopAllTasks();
}
}
void stopCalibration() {
if (!HTMCstartCal(HTCOMPASS_PORT)) {
eraseDisplay();
nxtDisplayTextLine(1, "ERROR: Calibration");
nxtDisplayTextLine(2, "has failed.");
nxtDisplayTextLine(4, "Check connection");
nxtDisplayTextLine(5, "and try again.");
PlaySound(soundException);
65
while(bSoundActive);
wait1Msec(5000);
StopAllTasks();
} else {
nxtDisplayTextLine(1, "SUCCESS: ");
nxtDisplayTextLine(2, "Calibr. done.");
PlaySound(soundUpwardTones);
while(bSoundActive);
wait1Msec(5000);
}
}
task main () {
int numDegrees = 0;
nMotorEncoder[M_RIGHT] = 0;
nMotorEncoder[M_LEFT] = 0;
// This will make the robot spin about 1.5 times, depends on many factors, YYMV, etc
numDegrees = ((numRotations() * 3) / 2) * 360;
nMotorEncoderTarget[M_RIGHT] = numDegrees;
StartTask(timeMe);
startCalibration();
motor[M_RIGHT] = MOTORSPEED;
motor[M_LEFT] = -MOTORSPEED;
while(nMotorRunState[M_RIGHT] != runStateIdle);
motor[M_LEFT] = 0;
stopCalibration();
wait1Msec(5000);
}
66
HTTMUX-test1.c
/**
* HTGYRO-driver.h provides an API for the HiTechnic Touch Sensor MUX. This program
* demonstrates how to use that API.
*
* Credits:
* - Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
*
* License: You may use this code as you wish, provided you give credit where it's due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
* Xander Soldaat (mightor_at_gmail.com)
* 08 March 2009
* version 0.1
*/
#include "drivers/HTTMUX-driver.h"
task main () {
string status;
while (true) {
eraseDisplay();
nxtDisplayTextLine(0, "HT Touch MUX");
nxtDisplayTextLine(1, "Test 1");
for (int i = 1; i < 5; i++) {
if (HTTMUXisActive(HTTMUX, i))
nxtDisplayTextLine(i+2, "Touch %d: on", i);
else
nxtDisplayTextLine(i+2, "Touch %d: off", i);
}
nxtDisplayTextLine(7, "Status: %d", HTTMUXgetActive(HTTMUX));
wait1Msec(50);
}
}
67
MAX127-test1.c
/**
* MAX127-driver.h provides an API for the MAXIM MAX127 ADC. This program
* demonstrates how to use that API.
*
* License: You may use this code as you wish, provided you give credit where it's due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
* Xander Soldaat (mightor_at_gmail.com)
* 08 March 2009
* version 0.1
*/
#include "drivers/MAX127-driver.h"
task main() {
int _chVal = 0;
nxtDisplayTextLine(3, "MAX127");
nxtDisplayTextLine(4, "Test prog");
wait1Msec(1000);
eraseDisplay();
while(true) {
eraseDisplay();
for (int i = 0; i < 8; i++) {
_chVal = MAX127readChan(MAX127, MAX127_I2C_ADDR, i);
// if the return value is < 0 then an error occurred
if (_chVal < 0) {
nxtDisplayTextLine(4, "ERROR!!");
wait1Msec(2000);
StopAllTasks();
}
nxtDisplayTextLine(i, "CH[%d]: %d", i, _chVal);
}
wait1Msec(100);
}
}
68
NXTCAM-test1.c
/**
* NXTCAM-driver.h provides an API for the Mindsensors NXTCam. This program
* demonstrates how to use that API.
*
* Credits:
* - Gordon Wyeth for writing the original driver and cam_display program
*
* License: You may use this code as you wish, provided you give credit where it's due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 1.46 AND HIGHER.
* Xander Soldaat (mightor_at_gmail.com)
* 07 March 2009
* version 0.2
*/
#include "drivers/common.h"
#include "drivers/NXTCAM-driver.h"
/*
Main task
*/
task main () {
blob_array _blobs;
// combine all colliding blobs into one
bool _condensed = true;
//blob_array _blobs;
int _l, _t, _r, _b;
int _nblobs;
eraseDisplay();
NXTCAMinit(cam);
while(true) {
eraseDisplay();
// Fetch all the blobs, have the driver combine all
// the colliding blobs.
_nblobs = NXTCAMgetBlobs(cam, _blobs, _condensed);
for (int i = 0; i < _nblobs; i++) {
// Draw the scaled blobs
_l = xscale(_blobs[i].x1);
_t = yscale(_blobs[i].y1);
_r = xscale(_blobs[i].x2);
_b = yscale(_blobs[i].y2);
nxtFillRect(_l, _t, _r, _b);
}
69
Index
_camera_cmd min, 8
NXTCAM-driver.h, 49 readI2C, 8
_merge ubyteToInt, 8
NXTCAM-driver.h, 50 waitForI2CBus, 8
_mergeBlobs writeI2C, 9
NXTCAM-driver.h, 50 CPM_MOTOR_BAK_PWM_1
_sortBlobs HTIRL-driver.h, 29
NXTCAM-driver.h, 50 CPM_MOTOR_BAK_PWM_2
_workAround HTIRL-driver.h, 29
HTPB-driver.h, 38 CPM_MOTOR_BAK_PWM_3
addI2CHead HTIRL-driver.h, 29
HTIRL-driver.h, 29 CPM_MOTOR_BAK_PWM_4
addI2CTail HTIRL-driver.h, 29
HTIRL-driver.h, 29 CPM_MOTOR_BAK_PWM_5
arr HTIRL-driver.h, 29
tByteArray, 4 CPM_MOTOR_BAK_PWM_6
tIntArray, 4 HTIRL-driver.h, 29
arrays_in_robotc_are_bugged_as_hell CPM_MOTOR_BAK_PWM_7
tIntArray, 5 HTIRL-driver.h, 29
blob, 3 CPM_MOTOR_BRAKE
colour, 3 HTIRL-driver.h, 29
size, 3 CPM_MOTOR_FLOAT
x1, 3 HTIRL-driver.h, 28
x2, 3 CPM_MOTOR_FWD_PWM_1
y1, 3 HTIRL-driver.h, 28
y2, 3 CPM_MOTOR_FWD_PWM_2
blob_array HTIRL-driver.h, 29
NXTCAM-driver.h, 49 CPM_MOTOR_FWD_PWM_3
BUF_DATASIZE HTIRL-driver.h, 29
HTIRL-driver.h, 28 CPM_MOTOR_FWD_PWM_4
BUF_HEADSIZE HTIRL-driver.h, 29
HTIRL-driver.h, 28 CPM_MOTOR_FWD_PWM_5
BUF_TAILSIZE HTIRL-driver.h, 29
HTIRL-driver.h, 28 CPM_MOTOR_FWD_PWM_6
CDM_MOTOR_BAK HTIRL-driver.h, 29
HTIRL-driver.h, 28 CPM_MOTOR_FWD_PWM_7
CDM_MOTOR_BRAKE HTIRL-driver.h, 29
HTIRL-driver.h, 28 done_workaround
CDM_MOTOR_FLOAT HTPB-driver.h, 39
HTIRL-driver.h, 28 DSP_1200
CDM_MOTOR_FWD HTDIR-driver.h, 19
HTIRL-driver.h, 28 DSP_600
clearI2CBus HTDIR-driver.h, 19
common.h, 8 eCDMMotorCommand
colour HTIRL-driver.h, 28
blob, 3 eCPMMotorCommand
common.h, 7 HTIRL-driver.h, 28
clearI2CBus, 8 eHTEOPDsensorRange
max, 8 HTEOPD-driver.h, 22
MAX_ARR_SIZE, 7 encodeBuffer
70
HTIRL-driver.h, 29 HTCS-driver.h, 14
HTAC_I2C_ADDR HTCS_I2CReply
HTAC-driver.h, 11 HTCS-driver.h, 16
HTAC_I2CReply HTCS_I2CRequest
HTAC-driver.h, 12 HTCS-driver.h, 16
HTAC_I2CRequest HTCS_RED_RAW_REG
HTAC-driver.h, 12 HTCS-driver.h, 14
HTAC_X_LOW HTCS_RED_REG
HTAC-driver.h, 11 HTCS-driver.h, 14
HTAC_X_UP HTCScalWhite
HTAC-driver.h, 11 HTCS-driver.h, 15
HTAC_Y_LOW HTCS-driver.h, 13
HTAC-driver.h, 11 HTCS_BLUE_RAW_REG, 14
HTAC_Y_UP HTCS_BLUE_REG, 14
HTAC-driver.h, 11 HTCS_CAL_WHITE, 14
HTAC_Z_LOW HTCS_CMD_REG, 14
HTAC-driver.h, 11 HTCS_COLNUM_REG, 14
HTAC_Z_UP HTCS_GREEN_RAW_REG, 14
HTAC-driver.h, 11 HTCS_GREEN_REG, 14
HTAC-driver.h, 10 HTCS_I2C_ADDR, 14
HTAC_I2C_ADDR, 11 HTCS_I2CReply, 16
HTAC_I2CReply, 12 HTCS_I2CRequest, 16
HTAC_I2CRequest, 12 HTCS_RED_RAW_REG, 14
HTAC_X_LOW, 11 HTCS_RED_REG, 14
HTAC_X_UP, 11 HTCScalWhite, 15
HTAC_Y_LOW, 11 HTCSreadColor, 15
HTAC_Y_UP, 11 HTCSreadColorIndex, 15
HTAC_Z_LOW, 11 HTCSreadNormRGB, 15
HTAC_Z_UP, 11 HTCSreadRawRGB, 15
HTACreadAllAxes, 11 HTCSreadRGB, 16
HTACreadX, 11 HTSC_BLUE_NORM_REG, 14
HTACreadY, 12 HTSC_COL_INDEX_REG, 14
HTACreadZ, 12 HTSC_GREEN_NORM_REG, 14
HTACreadAllAxes HTSC_RED_NORM_REG, 15
HTAC-driver.h, 11 HTCSreadColor
HTACreadX HTCS-driver.h, 15
HTAC-driver.h, 11 HTCSreadColorIndex
HTACreadY HTCS-driver.h, 15
HTAC-driver.h, 12 HTCSreadNormRGB
HTACreadZ HTCS-driver.h, 15
HTAC-driver.h, 12 HTCSreadRawRGB
HTCS_BLUE_RAW_REG HTCS-driver.h, 15
HTCS-driver.h, 14 HTCSreadRGB
HTCS_BLUE_REG HTCS-driver.h, 16
HTCS-driver.h, 14 HTDIR_AC_DIR
HTCS_CAL_WHITE HTDIR-driver.h, 18
HTCS-driver.h, 14 HTDIR_AC_SSTR1
HTCS_CMD_REG HTDIR-driver.h, 18
HTCS-driver.h, 14 HTDIR_AC_SSTR2
HTCS_COLNUM_REG HTDIR-driver.h, 18
HTCS-driver.h, 14 HTDIR_AC_SSTR3
HTCS_GREEN_RAW_REG HTDIR-driver.h, 18
HTCS-driver.h, 14 HTDIR_AC_SSTR4
HTCS_GREEN_REG HTDIR-driver.h, 18
HTCS-driver.h, 14 HTDIR_AC_SSTR5
HTCS_I2C_ADDR HTDIR-driver.h, 18
71
HTDIR_DC_DIR HTDIR-driver.h, 19
HTDIR-driver.h, 18 HTDIRreadAllDCStrength
HTDIR_DC_SAVG HTDIR-driver.h, 20
HTDIR-driver.h, 18 HTDIRreadDCAverage
HTDIR_DC_SSTR1 HTDIR-driver.h, 20
HTDIR-driver.h, 18 HTDIRreadDCDir
HTDIR_DC_SSTR2 HTDIR-driver.h, 20
HTDIR-driver.h, 18 HTDIRreadDCStrength
HTDIR_DC_SSTR3 HTDIR-driver.h, 20
HTDIR-driver.h, 18 HTDIRsetDSPMode
HTDIR_DC_SSTR4 HTDIR-driver.h, 20
HTDIR-driver.h, 19 HTEOPD_ILLEGAL_RANGE
HTDIR_DC_SSTR5 HTEOPD-driver.h, 22
HTDIR-driver.h, 19 HTEOPD_LONG_RANGE
HTDIR_DSP_MODE HTEOPD-driver.h, 22
HTDIR-driver.h, 19 HTEOPD_SHORT_RANGE
HTDIR_I2C_ADDR HTEOPD-driver.h, 22
HTDIR-driver.h, 19 HTEOPD-driver.h, 22
HTDIR_I2CReply eHTEOPDsensorRange, 22
HTDIR-driver.h, 21 HTEOPD_ILLEGAL_RANGE, 22
HTDIR_I2CRequest HTEOPD_LONG_RANGE, 22
HTDIR-driver.h, 21 HTEOPD_SHORT_RANGE, 22
HTDIR-driver.h, 17 HTEOPDgetProcessed, 23
DSP_1200, 19 HTEOPDgetRange, 23
DSP_600, 19 HTEOPDgetRaw, 23
HTDIR_AC_DIR, 18 HTEOPDsetLongRange, 23
HTDIR_AC_SSTR1, 18 HTEOPDsetRange, 23
HTDIR_AC_SSTR2, 18 HTEOPDsetShortRange, 23
HTDIR_AC_SSTR3, 18 HTEOPDgetProcessed
HTDIR_AC_SSTR4, 18 HTEOPD-driver.h, 23
HTDIR_AC_SSTR5, 18 HTEOPDgetRange
HTDIR_DC_DIR, 18 HTEOPD-driver.h, 23
HTDIR_DC_SAVG, 18 HTEOPDgetRaw
HTDIR_DC_SSTR1, 18 HTEOPD-driver.h, 23
HTDIR_DC_SSTR2, 18 HTEOPDsetLongRange
HTDIR_DC_SSTR3, 18 HTEOPD-driver.h, 23
HTDIR_DC_SSTR4, 19 HTEOPDsetRange
HTDIR_DC_SSTR5, 19 HTEOPD-driver.h, 23
HTDIR_DSP_MODE, 19 HTEOPDsetShortRange
HTDIR_I2C_ADDR, 19 HTEOPD-driver.h, 23
HTDIR_I2CReply, 21 HTGYRO_offsets
HTDIR_I2CRequest, 21 HTGYRO-driver.h, 26
HTDIRreadACDir, 19 HTGYROcalibrate
HTDIRreadACStrength, 19 HTGYRO-driver.h, 25
HTDIRreadAllACStrength, 19 HTGYRO-driver.h, 25
HTDIRreadAllDCStrength, 20 HTGYRO_offsets, 26
HTDIRreadDCAverage, 20 HTGYROcalibrate, 25
HTDIRreadDCDir, 20 HTGYROgetCalibration, 25
HTDIRreadDCStrength, 20 HTGYROreadRot, 26
HTDIRsetDSPMode, 20 HTGYROsetCalibration, 26
tHTDIRDSPMode, 19 HTGYROgetCalibration
HTDIRreadACDir HTGYRO-driver.h, 25
HTDIR-driver.h, 19 HTGYROreadRot
HTDIRreadACStrength HTGYRO-driver.h, 26
HTDIR-driver.h, 19 HTGYROsetCalibration
HTDIRreadAllACStrength HTGYRO-driver.h, 26
72
HTIRL-driver.h, 27 HTIRS_I2CReply, 33
addI2CHead, 29 HTIRS_I2CRequest, 33
addI2CTail, 29 HTIRS_SSTR1, 32
BUF_DATASIZE, 28 HTIRS_SSTR2, 32
BUF_HEADSIZE, 28 HTIRS_SSTR3, 32
BUF_TAILSIZE, 28 HTIRS_SSTR4, 32
CDM_MOTOR_BAK, 28 HTIRS_SSTR5, 32
CDM_MOTOR_BRAKE, 28 HTIRSreadAllStrength, 32
CDM_MOTOR_FLOAT, 28 HTIRSreadDir, 32
CDM_MOTOR_FWD, 28 HTIRSreadStrength, 33
CPM_MOTOR_BAK_PWM_1, 29 HTIRSreadAllStrength
CPM_MOTOR_BAK_PWM_2, 29 HTIRS-driver.h, 32
CPM_MOTOR_BAK_PWM_3, 29 HTIRSreadDir
CPM_MOTOR_BAK_PWM_4, 29 HTIRS-driver.h, 32
CPM_MOTOR_BAK_PWM_5, 29 HTIRSreadStrength
CPM_MOTOR_BAK_PWM_6, 29 HTIRS-driver.h, 33
CPM_MOTOR_BAK_PWM_7, 29 HTMC_CALIBRATE_CMD
CPM_MOTOR_BRAKE, 29 HTMC-driver.h, 34
CPM_MOTOR_FLOAT, 28 HTMC_HEAD_L
CPM_MOTOR_FWD_PWM_1, 28 HTMC-driver.h, 35
CPM_MOTOR_FWD_PWM_2, 29 HTMC_HEAD_U
CPM_MOTOR_FWD_PWM_3, 29 HTMC-driver.h, 35
CPM_MOTOR_FWD_PWM_4, 29 HTMC_I2C_ADDR
CPM_MOTOR_FWD_PWM_5, 29 HTMC-driver.h, 35
CPM_MOTOR_FWD_PWM_6, 29 HTMC_I2CReply
CPM_MOTOR_FWD_PWM_7, 29 HTMC-driver.h, 36
eCDMMotorCommand, 28 HTMC_I2CRequest
eCPMMotorCommand, 28 HTMC-driver.h, 36
encodeBuffer, 29 HTMC_MEASURE_CMD
PFcomboDirectMode, 29 HTMC-driver.h, 35
PFcomboPwmMode, 30 HTMC_MODE
START_DATA, 28 HTMC-driver.h, 35
START_HEAD, 28 HTMC-driver.h, 34
START_TAIL, 28 HTMC_CALIBRATE_CMD, 34
transmitIR, 30 HTMC_HEAD_L, 35
HTIRS_DIR HTMC_HEAD_U, 35
HTIRS-driver.h, 32 HTMC_I2C_ADDR, 35
HTIRS_I2C_ADDR HTMC_I2CReply, 36
HTIRS-driver.h, 32 HTMC_I2CRequest, 36
HTIRS_I2CReply HTMC_MEASURE_CMD, 35
HTIRS-driver.h, 33 HTMC_MODE, 35
HTIRS_I2CRequest HTMCreadHeading, 35
HTIRS-driver.h, 33 HTMCreadRelativeHeading, 35
HTIRS_SSTR1 HTMCsetTarget, 35
HTIRS-driver.h, 32 HTMCstartCal, 36
HTIRS_SSTR2 HTMCstopCal, 36
HTIRS-driver.h, 32 target, 36
HTIRS_SSTR3 HTMCreadHeading
HTIRS-driver.h, 32 HTMC-driver.h, 35
HTIRS_SSTR4 HTMCreadRelativeHeading
HTIRS-driver.h, 32 HTMC-driver.h, 35
HTIRS_SSTR5 HTMCsetTarget
HTIRS-driver.h, 32 HTMC-driver.h, 35
HTIRS-driver.h, 31 HTMCstartCal
HTIRS_DIR, 32 HTMC-driver.h, 36
HTIRS_I2C_ADDR, 32 HTMCstopCal
73
HTMC-driver.h, 36 HTCS-driver.h, 15
HTPB_A0_L HTTMUX-driver.h, 40
HTPB-driver.h, 38 HTTMUXgetActive, 40
HTPB_A0_U HTTMUXisActive, 40
HTPB-driver.h, 38 HTTMUXgetActive
HTPB_DIGCTRL HTTMUX-driver.h, 40
HTPB-driver.h, 38 HTTMUXisActive
HTPB_DIGIN HTTMUX-driver.h, 40
HTPB-driver.h, 38 max
HTPB_DIGOUT common.h, 8
HTPB-driver.h, 38 MAX_ARR_SIZE
HTPB_I2C_ADDR common.h, 7
HTPB-driver.h, 38 MAX_BLOBS
HTPB_I2CReply NXTCAM-driver.h, 49
HTPB-driver.h, 39 MAX127_I2C_ADDR
HTPB_I2CRequest MAX127-driver.h, 42
HTPB-driver.h, 39 MAX127_I2CReply
HTPB_SRATE MAX127-driver.h, 43
HTPB-driver.h, 38 MAX127_I2CRequest
HTPB-driver.h, 37 MAX127-driver.h, 43
_workAround, 38 MAX127-driver.h, 42
done_workaround, 39 MAX127_I2C_ADDR, 42
HTPB_A0_L, 38 MAX127_I2CReply, 43
HTPB_A0_U, 38 MAX127_I2CRequest, 43
HTPB_DIGCTRL, 38 MAX127readChan, 42
HTPB_DIGIN, 38 MAX127readChan
HTPB_DIGOUT, 38 MAX127-driver.h, 42
HTPB_I2C_ADDR, 38 MCP_BIT_DISSLW
HTPB_I2CReply, 39 MCP23008-driver.h, 45
HTPB_I2CRequest, 39 MCP_BIT_INTPOL
HTPB_SRATE, 38 MCP23008-driver.h, 45
HTPBReadADC, 38 MCP_BIT_ODR
HTPBReadAllADC, 38 MCP23008-driver.h, 45
HTPBReadIO, 39 MCP_BIT_SREAD
HTPBSetSamplingTime, 39 MCP23008-driver.h, 45
HTPBSetupIO, 39 MCP_I2C_ADDR
HTPBWriteIO, 39 MCP23008-driver.h, 45
HTPBReadADC MCP_REG_DEFVAL
HTPB-driver.h, 38 MCP23008-driver.h, 45
HTPBReadAllADC MCP_REG_GPINTEN
HTPB-driver.h, 38 MCP23008-driver.h, 45
HTPBReadIO MCP_REG_GPIO
HTPB-driver.h, 39 MCP23008-driver.h, 45
HTPBSetSamplingTime MCP_REG_GPPU
HTPB-driver.h, 39 MCP23008-driver.h, 45
HTPBSetupIO MCP_REG_INTCAP
HTPB-driver.h, 39 MCP23008-driver.h, 45
HTPBWriteIO MCP_REG_INTCON
HTPB-driver.h, 39 MCP23008-driver.h, 45
HTSC_BLUE_NORM_REG MCP_REG_INTF
HTCS-driver.h, 14 MCP23008-driver.h, 45
HTSC_COL_INDEX_REG MCP_REG_IOCON
HTCS-driver.h, 14 MCP23008-driver.h, 46
HTSC_GREEN_NORM_REG MCP_REG_IODIR
HTCS-driver.h, 14 MCP23008-driver.h, 46
HTSC_RED_NORM_REG MCP_REG_IPOL
74
MCP23008-driver.h, 46 _camera_cmd, 49
MCP_REG_OLAT _merge, 50
MCP23008-driver.h, 46 _mergeBlobs, 50
MCP23008_I2CReply _sortBlobs, 50
MCP23008-driver.h, 47 blob_array, 49
MCP23008_I2CRequest MAX_BLOBS, 49
MCP23008-driver.h, 47 NXTCAM_CMD_REG, 49
MCP23008-driver.h, 44 NXTCAM_COUNT_REG, 49
MCP_BIT_DISSLW, 45 NXTCAM_DATA_REG, 49
MCP_BIT_INTPOL, 45 NXTCAM_I2C_ADDR, 49
MCP_BIT_ODR, 45 NXTCAM_I2CReply, 51
MCP_BIT_SREAD, 45 NXTCAM_I2CRequest, 51
MCP_I2C_ADDR, 45 NXTCAMgetAverageCenter, 50
MCP_REG_DEFVAL, 45 NXTCAMgetBlobs, 50, 51
MCP_REG_GPINTEN, 45 NXTCAMinit, 51
MCP_REG_GPIO, 45 SIDE_CENTER, 49
MCP_REG_GPPU, 45 still_merging, 51
MCP_REG_INTCAP, 45 NXTCAMgetAverageCenter
MCP_REG_INTCON, 45 NXTCAM-driver.h, 50
MCP_REG_INTF, 45 NXTCAMgetBlobs
MCP_REG_IOCON, 46 NXTCAM-driver.h, 50, 51
MCP_REG_IODIR, 46 NXTCAMinit
MCP_REG_IPOL, 46 NXTCAM-driver.h, 51
MCP_REG_OLAT, 46 PFcomboDirectMode
MCP23008_I2CReply, 47 HTIRL-driver.h, 29
MCP23008_I2CRequest, 47 PFcomboPwmMode
MCP23008ReadIO, 46 HTIRL-driver.h, 30
MCP23008ReadReg, 46 readI2C
MCP23008SetupIO, 46, 47 common.h, 8
MCP23008WriteIO, 47 SIDE_CENTER
MCP23008WriteReg, 47 NXTCAM-driver.h, 49
MCP23008ReadIO size
MCP23008-driver.h, 46 blob, 3
MCP23008ReadReg START_DATA
MCP23008-driver.h, 46 HTIRL-driver.h, 28
MCP23008SetupIO START_HEAD
MCP23008-driver.h, 46, 47 HTIRL-driver.h, 28
MCP23008WriteIO START_TAIL
MCP23008-driver.h, 47 HTIRL-driver.h, 28
MCP23008WriteReg still_merging
MCP23008-driver.h, 47 NXTCAM-driver.h, 51
min stupid_work_around_for_array_bug
common.h, 8 tByteArray, 4
NXTCAM_CMD_REG target
NXTCAM-driver.h, 49 HTMC-driver.h, 36
NXTCAM_COUNT_REG tByteArray, 4
NXTCAM-driver.h, 49 arr, 4
NXTCAM_DATA_REG stupid_work_around_for_array_bug, 4
NXTCAM-driver.h, 49 tHTDIRDSPMode
NXTCAM_I2C_ADDR HTDIR-driver.h, 19
NXTCAM-driver.h, 49 tIntArray, 4
NXTCAM_I2CReply arr, 4
NXTCAM-driver.h, 51 arrays_in_robotc_are_bugged_as_hell, 5
NXTCAM_I2CRequest transmitIR
NXTCAM-driver.h, 51 HTIRL-driver.h, 30
NXTCAM-driver.h, 48 ubyteToInt
75
common.h, 8 x2
waitForI2CBus blob, 3
common.h, 8 y1
writeI2C blob, 3
common.h, 9 y2
x1 blob, 3
blob, 3
76