Pros Potentiometer Auton Switcher

Hello, I am new to pros and overall a novice programmer. I am having an issue with pros where I am trying to make an autonomous switcher using a potentiometer and I have it defined, and externed, but for some reason when I run autonomous, it just runs the first void statement under the if, (automatically runs blue). I have attached the excerpt from my code that is supposed to allow for switching between two of my autonomous’. Any help or suggestions are appreciated!
Auton Pot.PNG

Nothing appears to have been attached to this post

My bad. Must not have uploaded the first time. Should be fixed now

I’d recommend printing out the potentiometer value (e.g. in opcontrol on the display) and seeing if the value makes sense. If it doesn’t, post your code and we can take a look

I was checking on the cortex and it’s in analog 12 bit. Value between 5- 4000 depending on where the pot is turned. I use a pot for my catapult and it works fine, but for some reason its just skipping it in auton

I preset the pot before the match, having it labeled for each auton. I wanted to stray away from using initialize, because I didn’t want to be strapped down with a competition switch every time I wanted to run auton as we had to donate them all to our middle school teams. If I place the code in a while loop wont it not be able to move on after auton?

Make sure you are properly initializing the potentiometer, I’m using C so the command is


but I’m not sure what it is for C++.

I ended up through my own trouble shooting determining that the issue was the potentiate did not have enough time to calibrate before the auton was called. What ended up working was adding a delay before the if statement to allow the pot time to calibrate. I settled on 250 msec, but you could get away with less.