Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Help: Auto selector (http://www.chiefdelphi.com/forums/showthread.php?t=146514)

whitetail 03-31-2016 04:13 PM

Help: Auto selector
 
We have multiple auto programs and we have to switch them in the code but would like to select them on smart dashboard. We are coding in Java and writing our code in the Iterative style. Any help would be appreciated!

Pault 03-31-2016 09:23 PM

Re: Help: Auto selector
 
https://wpilib.screenstepslive.com/s...smartdashboard

The example they give adds Commands to the SendableChooser. However, because you are using iterative, you can put a number or a String or an enum or something in place of where it has "new Pickup ()" and "new ElevatorPickup", and then getSelected () will return that numbwr/whatever associated with the selected option, so you can use that in an if statement to decide which Auton you want to run.


All times are GMT -5. The time now is 07:22 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi