Hi Vince,
Looks like traffic is a bit light in this forum lately. I just started working with WPILib this summer, and this one had me confused for a bit too. So, even if you've already figured it out, I thought an answer would be helpful for others who might hit the same issue.
The key is to look at the API.h header file. There you will see an function that for some reason is not mentioned in the .PDF documentation. DefineControllerIO() not only lets you specify the I/O direction for each port, but on the Vex also lets you specify as the first argument the number of analog channels to be used:
Code:
#ifdef _FRC_BOARD
void DefineControllerIO(unsigned char p1, unsigned char p2, unsigned char p3, unsigned char p4,
unsigned char p5, unsigned char p6, unsigned char p7, unsigned char p8,
unsigned char p9, unsigned char p10, unsigned char p11, unsigned char p12,
unsigned char p13, unsigned char p14, unsigned char p15, unsigned char p16,
unsigned char p17, unsigned char p18);
#endif // _FRC_BOARD
#ifdef _VEX_BOARD
void DefineControllerIO(unsigned char numberOfAnalogChannels,
unsigned char p1, unsigned char p2, unsigned char p3, unsigned char p4,
unsigned char p5, unsigned char p6, unsigned char p7, unsigned char p8,
unsigned char p9, unsigned char p10, unsigned char p11, unsigned char p12,
unsigned char p13, unsigned char p14, unsigned char p15, unsigned char p16);
#endif // _VEX_BOARD
The first
n channels will be analog, where
n is the first parameter of the Vex-specific function. Although I haven't actually tried it, I assume you could make all 16 channels analog in this way if you so desired.
Hope this helps!