Go to Post We should be celebrating every potential new science and technology leader regardless of which number is on his/her t-shirt. - Dmentor [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-10-2007, 02:21
SomeoneKnows SomeoneKnows is offline
SomeoneKnows
AKA: Vince Thompson
FRC #1752 (Team Tonka)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: KC Missouri
Posts: 19
SomeoneKnows is a glorious beacon of lightSomeoneKnows is a glorious beacon of lightSomeoneKnows is a glorious beacon of lightSomeoneKnows is a glorious beacon of lightSomeoneKnows is a glorious beacon of light
WPILib & Analog/Digitial IO Split on Vex

I'm working with the Vex and WPILib and have a question about configuring Analog / Digital ports. On page 33 of the WPILib programming document it talks about the 16 ports being split between analog and digital. It says the analog ports are the lower numbered ports below the split and the digital porta are the larger numbered ports. I looked at the Vex documentation and it doesn't seem to specify this split location. The Easy C Options->ControllerConfiguration feature shows ports 1 through 4 as default Analog Inputs but the Controller Configuration user interface will let me set all 16 ports to Analog Input.

What is the Analog/Digital split location the WPILib documentation is referring to?

Since the Easy C Controller Configuration will allow user definition of I/O ports why doesn't WPILib have a way to set this configuration?

Is there a way around the Analog port limit that WPILib claims?

Vince Thompson
  #2   Spotlight this post!  
Unread 22-10-2007, 00:52
Abrakadabra Abrakadabra is offline
Here We Go !!!
AKA: Scott Kukshtel, Mr. K
FRC #3467 (The Windham Windup!)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Windham, New Hampshire
Posts: 160
Abrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant future
Re: WPILib & Analog/Digitial IO Split on Vex

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!
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
WPILib & Camera colors & data Thanatos Programming 2 19-02-2007 01:15
WPIlib beta for VEX Kurt Jensen Programming 0 05-10-2006 01:44
Using WPILib on a Vex robot koenig3456 Programming 2 02-05-2006 14:56
IRI VEX Q&A Kyle Love Off-Season Events 0 08-07-2005 23:51
VEX & FIRST in Newsweek! Rich Wong FIRST In the News... 2 22-03-2005 13:36


All times are GMT -5. The time now is 03:26.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi