Our team is trying to use the enhanced IO on the driver station this year because we are going to be using 13 digital inputs. I am having trouble getting the code correct I believe. When we try to enable the robot, the robot loses communication and we are seeing this error:
"Fatal error "IO is not attached or Enhanced IO is not enabled." in GetAnalogInRatio() in C:/windriver/workspace/WPILib/DriverStationEnhancedIO.cpp at 201"
I believe this error maybe because I am not setting everything up correctly in my code and it is crashing at run time. My problem is that the example code in the WPI User guide is setup for the SimpleRobot and we always use the IterativeRobot with the additional pointer stuff. Here's my current code:
under the class
Code:
class IterativeDemo : public IterativeRobot
{
DriverStationEnhancedIO *ds; // driver station object
under the constructor:
Code:
public:
IterativeDemo(void) {
ds = &DriverStation::GetInstance()->GetEnhancedIO(); //new for 2011 - Configurable Pins
use example during the teleoperated:
Code:
HiLoSwitch = ds->GetDigital(1); //Toggle switch for tower approach
GetTubeButton = ds->GetDigital(2); //Button for Getting tube pickup
I suspect I am not constructing the ds variable correctly and everything is dying from there. I cannot find an example using the EnhancedIO driver station using the pointer method of variable handling that is done in IterativeRobot.
Can someone help us figure out what we are doing wrong. We'll get you whatever additional info you may need.