Thread: Code problem
View Single Post
  #2   Spotlight this post!  
Unread 13-02-2015, 13:22
Adamz_'s Avatar
Adamz_ Adamz_ is offline
Who wants coffee?
AKA: Connor Adams
FRC #4519 (Kings Mechavaliers)
Team Role: Mentor
 
Join Date: May 2013
Rookie Year: 2013
Location: Oakville
Posts: 33
Adamz_ is a splendid one to beholdAdamz_ is a splendid one to beholdAdamz_ is a splendid one to beholdAdamz_ is a splendid one to beholdAdamz_ is a splendid one to beholdAdamz_ is a splendid one to beholdAdamz_ is a splendid one to behold
Re: Code problem

Based on the block of code below, i feel its safe to assume that you have differnt classes for all of the commands you wish to run once the button is pressed, and it would be easier to diagnose if you posted your full robot code.

If this is infact your only class, your attempting to refernce a null command, so the button press is trying to reach a null comand, in result doing nothing.
Quote:
Originally Posted by AnnaliseDonavan View Post
Code:
   	button1.whenPressed(new ElevatorOff());
    	button2.whenPressed(new ElevatorOn());
    	button3.whenPressed(new ElevatorReverse());
    	button4.whenPressed(new ArmsOut());
    	button5.whenPressed(new ArmsIn());
    	button6.whenPressed(new ArmsVerticalIn());
    	button7.whenPressed(new ArmsVarticalOut());
    	button8.whenPressed(new BlueLightShow());
    	button9.whenPressed(new LigthShowOn());
    	button10.whenPressed(new RedLightShow());
    	button11.whenPressed(new LightShowEnd());
__________________
2016 North Bay Regional Finalists
2016 Greater Toronto Central Regional Semi-Finalists
2015 Windsor Essex Great Lakes Regional Quarter-Finalists
2014 Windsor Essex Great Lakes Regional Semi-Finalists
2014 Waterloo Regional Quarter-finalists
2013 Waterloo Regional Highest Rookie Seed
2013 Waterloo Regional Rookie All Star Recipient
Reply With Quote