Quote:
Originally Posted by ahartnet
1) should this go in the robot init like in the example? Doesn't that mean you need to reboot the Rio every time you change the file?
|
We typically read preferences either in disabled init or inline with where the data is used (based on how often we want to be able to updated it).
Quote:
Originally Posted by ahartnet
2) we can't seem to get anything to show up in the preferences. The things that I have found in the forums are a couple of years old so I'm not sure if it's changed.
|
The code on screensteps doesn't put any data to the preferences, just reads existing data. You can either add the data using SmartDashboard, or put it in your code. Generally, if our robot code reads a value and it doesn't exist the code immediately puts a default value to preferences.
Quote:
Originally Posted by ahartnet
3) if we create a key in the preferences table that doesn't exist in the code does that have any impact?
|
No.
Quote:
Originally Posted by ahartnet
4) we trying declaring the variables as public in our robot.java but while in other commands or subsystems it doesn't seem like we could use them. Is there something I'm missing there?
|
You need to references them as Robot.value. Or you could just read the preferences in your command or subsystem.