To use the DriverStation functions, you have to create a DriverStation pointer and set it with DriverStation::GetInstance(). You can then use GetDigitalIn only on the first 8 pins. The DS must also be set to Compatible I/O mode (through I/O screen). If you want to use any of the advanced functionality available through the PSoC board, the system is a bit different (will show with code)
Using DriverStation
Code:
public:
...
DriverStation *ds;
...
MyRobot() {
...
ds = DriverStation::GetInstance()
...
}
Teleop() {
...
switch = ds->GetDigitalIn(1);
...
}
Using DriverStationEnhancedIO:
Code:
Teleop() {
DriverStationEnhancedIO& dsio = DriverStation::GetInstance()->GetEnhancedIO();
...
switch = dsio.GetDigital(1);
...
}
IMO you should use the DriverStationEnhancedIO version since you can have more control over the PSoC (pulled high/pulled low, input/output, encoder support, LEDs)
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"