|
Re: Programming Toggle Swiches
There are a couple things to do here. One task is to get toggle switches connected to the Cypress board. You also need to write code. If you want to write the code first, or do the tasks in parallel with someone else, you can disconnect the board from the DS and simply change the digital inputs on the I/O screen directly (this assumes you are using the compatible mode for I/O).
Once this works, or the physical toggles are connected and control the switches on the screen of the DS I/O tab, you want to read those in Autonomous. The VI for this is in palette at WPILib>>Driver Station>>Compatibility I/O>>Get Digital Inputs. It returns an array, and you can retrieve the Booleans from the array using an array indexer or other means. I'd recommend combining the Booleans together into a number and wiring the number to a switch statement around most of your autonomous code. You'll probably find it useful to get the refnums in common code outside the switch, and then put the various autonomous with. You can also make the autonomous routines into subVIs too and simply call them from within the switch statement.
Greg McKaskle
|