|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Preferences table Null Pointer Exception
The sample on that page seems to be missing a line:
prefs = Preferences.getInstance(); |
|
#2
|
||||
|
||||
|
Re: Preferences table Null Pointer Exception
Quote:
Code:
package org.usfirst.frc.team40.robot;
import edu.wpi.first.wpilibj.SampleRobot;
import edu.wpi.first.wpilibj.Preferences;
public class Robot extends SampleRobot{
Preferences prefs;
double armUpPosition;
double armDownPosition;
public void robotInit(){
prefs = Preferences.getInstance();
armUpPosition = prefs.getDouble("ArmUpPosition", 1.0);
armDownPosition = prefs.getDouble("ArmDownPosition", 4.0);
}
}
|
|
#3
|
|||
|
|||
|
Re: Preferences table Null Pointer Exception
Thank you, I appreciate it. This fixed our problem.
|
|
#4
|
|||
|
|||
|
Re: Preferences table Null Pointer Exception
If you didn't do so already, please use the form on the page to report the error.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|