I am using C++ pro in VCS and am trying to use a potentiometer to select my autonomous like I have in previous years but have been unable to make it work. I declared the pot in the config screen using the correct syntax from the API, and then attempt to use it in autonomous to select my routine:
vex::pot Pot = vex::pot(Brain.ThreeWirePort.B);
void autonomous( void )
{
if(Pot.value(vex::analogUnits::range8bit) < 400)
{
dist = 400;
forward();
}
else if(Pot.value(vex::analogUnits::range8bit) < 800)
{
}
etc.
}
I can see the potentiometer value in devices on the brain screen, but it will run the code in the first if statement regardless of the pot’s value. I tried using percentUnits::pct and rotationUnits::deg with the same result. I previously had tried to use a bump sensor for another application and while I could see its value on the brain screen, the code ignored it as well. Any help would be appreciated.