View Single Post
  #8   Spotlight this post!  
Unread 08-01-2016, 02:04 PM
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: FTC NullPointerException

Please try this instead. I think the initialization of rd is too early. Moving it to the init() method should work. BTW, this is primarily an FRC forum, you may get better response from the FTC forums http://ftcforum.usfirst.org/forumdis...Android-Studio
Code:
public class Brain extends OpMode {
    private int statusDriveInteger = 76;
    private RobotDrive rd;

    public void init () {
        rd = new RobotDrive(hardwareMap);
        statusDriveInteger = rd.statusRobotDrive();

        telemetry.addData("here ",statusDriveInteger);
    }

    public void loop (){
        telemetry.addData("here pre",statusDriveInteger);
        rd.setPowerLeftRearDrive(1.0);
        telemetry.addData("here post",statusDriveInteger);

    }

}
__________________
Reply With Quote