Sure. In your code, you'll need to have something like this:
Code:
class MyRobot : public SimpleRobot{
// Member variables (DigitalInputs, Joysticks, Jaguars, etc)
DriverStation *ds;
// Default constructor
MyRobot(){
// Initializations for all your other variables
ds = DriverStation::GetInstance();
}
void OperatorControl(){
float a_variable;
while ( IsOperatorControl() ){
OtherFunctionCalls();
a_variable = ds->GetAnalogIn(1); // returns value of whatever's connected to analog input 1 of the DS
if(ds->GetDigitalIn(2)) { // checks state of DS digital input 2
DoSomething();
}
else{
DoSomethingElse();
}
}
}
};
Does that clear things up a bit?
It'll be slightly different if you're using the IterativeRobot template instead of SimpleRobot, but the Driver Station function calls are the same.