Driver Station for Autonomous

Apologies if this is misplaced or if this has been answered somewhere else, but are we allowed to use an analog sensor/input (specifically a potentiometer) on the driver station to choose autonomous modes? I’m currently understanding that we can’t use any digital inputs to choose autonomous.

As far as I know, you can use either analog or digital inputs on the DS. I don’t know of any rules limiting that. In fact, we will be adding a switch to our DS as insurance. What I mean by that is that we already have our code set to receive our alliance info from the FMS. That way it will automatically target the correct color set. The switch will be coded in if the FMS, for some odd reason, does not provide the information that the new vi’s are looking for.

You can read information from your DS (either analog or digital) during Autonomous/Disabled mode. During Autonomous/Enabled your DS will not pass inputs on to the cRIO.

See Team Update 9 for details of how the robots will be cycled through the various states during a match.

A very very simple way of choosing autonomous modes would be having a bank of switches in a safe place on your robot, and base your programming off whether or not any of those switches are turned on or off.

You may read digital inputs, or analog inputs, on the DS to use in selecting autonomous modes. When the robot is enabled, these values will read as zero. What you do is read these values during each cycle of the disabledperiodic() call and save the computed mode in a static variable. You actually have to use two such variables because the inputs will be unreliable on the last disabledperiodic() call. Use the second variable to buffer the value computed in the prior call, and use this value in the autonomous periodic call.

Eugene

Ah… So does that mean I should have two variables, an old variable and the new one, then check if the new one is zero. If it’s zero, use the old variable, if it’s not, replace the old with the new?

I wonder if that makes sense. Thanks all!