![]() |
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*;Thanks!!! ps the ctrs, rs, etc are the short hand names for our auto modes. |
Re: Use of SmartDashboard::GetString()
I'm going to warn you up front; I don't use C++, I use Java. That being said, I believe the correct way to get your string would be "autoMode = SmartDashboard::GetString("Auto", "Default");". The first argument is the key you are reading from (on SmartDashboard it should be the title next to the text field) and the second argument is the default that will be used if there is no data.
|
Re: Use of SmartDashboard::GetString()
A better solution would be to use a SenableChooser. The following is for command based but sendable chooser uses void* so the sky is the limit as to what you send. You can send a command, number, or some other pointer.
Code:
class Robot : public IterativeRobothttp://wpilib.screenstepslive.com/s/...smartdashboard |
| All times are GMT -5. The time now is 03:48. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi