|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
|||
|
|||
|
Re: Access the Auto List on Driver Station in Java
Here's some sample code that should get you started.
Class members: final String defaultAuto = "Default"; final String customAuto = "My Auto"; String[] autoList = {defaultAuto, customAuto}; String autoSelected; in robotInit(): NetworkTable table = NetworkTable.getTable("SmartDashboard"); table.putStringArray("Auto List", autoList); in autonomousInit(): autoSelected = (String) chooser.getSelected(); System.out.println("Auto selected: " + autoSelected); in autonomousPeriodic(): switch(autoSelected) { case customAuto: //Put custom auto code here break; case defaultAuto: default: //Put default auto code here break; } |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|