Alright, so i'm working on just re-writing our 2015 robot's code so that it's a lot cleaner and whatnot, so future students can see a good example of a good project.
my question - one that i ran into during build season but never tested - is this: if i instantiate a double solenoid object, then put it in the Value.kForward position manually in teleop, then turn the bot off and re-upload the code, will the code be able to recognize that it is in the Value.kForward position during disabled?
the order of code being run:
first time:
Code:
public void RobotInit(){
piston = new DoubleSolenoid( ... , ...);
}
// then:
public void TeleopInit(){
piston.setValue(Value.kForward);
}
// then i power off the bot while piston is in forward position, and this happens after i turn it on again and reupload code:
public void RobotInit(){
piston = new DoubleSolenoid( ... , ...);
}
// then in disabledPeriodic
public void DisabledPeriodic(){
if(piston.get() == Value.kForward)
System.out.println("it's in the forward position");
else
System.out.println("it isn't or we don't know");
}
what would print in the example?