Go to Post You do use CAD to prototype, Cardboard Aided Design. - Peter Matteson [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 24-01-2016, 17:14
ahartnet's Avatar
ahartnet ahartnet is online now
Registered User
AKA: Andrew Hartnett
FRC #5414 (Pearadox)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2005
Location: Houston, Texas
Posts: 201
ahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond reputeahartnet has a reputation beyond repute
Re: Robot preferences help

d'oh! That was at least part of the problem.

Still having some issues that might be related to the scope or static-ness of the variable. For some reason in order to acces it in a different class, the code wants us to make it static.

Code:
public static double speed;

public void disabledInit(){
        prefs = Preferences.getInstance();
    	speed = prefs.getDouble("speed", 0.0);    
	SmartDashboard.putNumber("Pref speed", speed);
    }
Code:
     
	SmartDashboard.putNumber("Pref speed in different class", Robot.speed);
In smart dashboard we'll get
"Pref speed": # (this updates appropriately when we disable)
"Pref speed in different class": 0.0 (this stays at whatever we initially set it to no matter what this doesnt surprise me because it's declared as static).

Thanks for all the help so far.
__________________
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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:53.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi