View Single Post
  #3   Spotlight this post!  
Unread 12-02-2010, 19:05
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote