View Single Post
  #1   Spotlight this post!  
Unread 05-03-2015, 20:32
arichman1257's Avatar
arichman1257 arichman1257 is offline
VP, Control Systems Captain, Coach
AKA: Alan Richman
FRC #1257 (Parallel Universe)
Team Role: Electrical
 
Join Date: Dec 2014
Rookie Year: 2014
Location: Fanwood
Posts: 21
arichman1257 is on a distinguished road
Use of SmartDashboard::GetString()

I have to take input from the driver station in form of a string for use of switching between auto modes. Then I need to take said string and execute the auto mode accordingly. Something like the following:

Code:
string autoMode = *input from driver station*;

if (autoMode == ctrs)
{
   *auto code*;
}
else if (autoMode == rs)
{
   *other auto code*;
}
else if (autoMode == crs)
{
   *even more auto code*
}
else if (autoMode == no)
{
   *final auto code*;
}
else
   *do nothing*;
So what I need is an example of how to get a string from the driver station using the SmartDashboard::GetString().

Thanks!!!

ps the ctrs, rs, etc are the short hand names for our auto modes.
Reply With Quote