View Single Post
  #2   Spotlight this post!  
Unread 19-02-2013, 16:35
pblankenbaker pblankenbaker is offline
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 102
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: Javadoc not found, victors not responding

Your program extends the SimpleRobot class. When you create a program using this as your base class, your operatorControl() method is called exactly one time during the match. So, you want to place the code you want to run inside a while loop. For example in the following, I renamed your method to "checkUserInputs()" and updated the operatorControl() method to call your method continuously while the robot is enabled and in the teleop period:

Code:
    /*
     * This function checks for and reacts to user inputs.
     */
    public void checkUserInputs() {
       
    double stickX = stick.getX();
    
    armX.setPosition(stickX*0.25);
    
    double throttle = stick.getThrottle();
    
    if(stick.getRawButton(3)){
        armY.set(stickX/throttle);
        System.out.println("Button 3 pressed");
    }
    if(switch1.get()){
        armX.set(0.2);
        Timer.delay(0.2);
        armX.set(0.0);
    }
    }

    /*
     * This function is called once each time the robot enters operator control.
     */
    public void operatorControl() {
       while (isOperatorControl() && isEnabled()) {
          checkUserInputs();
       }
    }
Reply With Quote