Log in

View Full Version : Smart Dashboard Preferences Issue


jagow100
16-02-2015, 17:00
We have found that when you follow the code here on Screensteps: http://wpilib.screenstepslive.com/s/3120/m/7932/l/81114-setting-robot-preferences-from-smartdashboard you get a null pointer exception. When you initialize the Preference object, you receive a not visible error, we're assuming this is because the constructor for preferences is private. How do we get this to work?

nandeeka
16-02-2015, 21:49
You need a line like:

Preferences* prefs = Preferences::GetInstance();

or

Preferences prefs = Preferences.getInstance();

depending on the language.