View Single Post
  #3   Spotlight this post!  
Unread 24-01-2016, 15:49
ahartnet's Avatar
ahartnet ahartnet is offline
Registered User
AKA: Andrew Hartnett
FRC #5414 (Pearadox)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2005
Location: Houston, Texas
Posts: 194
ahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant futureahartnet has a brilliant future
Re: Robot preferences help

Thanks for the suggestions! I like putting it into the disabledInit() function.

Still having some problems though.

Code:
public class Robot extends IterativeRobot {
	public static double speed;
	Preferences prefs;
        //Other stuff
}
    public void disabledInit(){

    	speed = prefs.getDouble("speed", .5);
    	
    }
And then later on in a different class
Code:
     value = Robot.speed;
However we're having issues where we're getting an unhandled exception for a null pointer in the disabledInit function, so the driver station is listing as "no robot code"

Any suggestions?
__________________
Team 451 The Cat Attack, Student Alumni (2005)
Team 1646 Precision Guessworks, Mentor (2006-2008)
Team 2936 Gatorzillas, Mentor (2011-2014)
Team 5414 Pearadox, Mentor (2015-Present)
Reply With Quote