![]() |
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 |
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_BOARDHope this helps! |
| All times are GMT -5. The time now is 18:12. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi