// RobotBuilder Version: 0.0.2
//
// This file was generated by RobotBuilder. It contains sections of
// code that are automatically generated and assigned by robotbuilder.
// These sections will be updated in the future when you export to
// Java from RobotBuilder. Do not put any code or make any change in
// the blocks indicating autogenerated code or it will be lost on an
// update. Deleting the comments indicating the section will prevent
// it from being updated in th future.
package org.usfirst.frc330.Beachbot2013Java;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.buttons.JoystickButton;
import org.usfirst.frc330.Beachbot2013Java.commands.*;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
/*
 * $Log: OI.java,v $
 * Revision 1.18  2013-03-15 03:08:37  echan
 * Added the command to shoot low at full speed
 *
 * Revision 1.17  2013-03-15 02:50:16  echan
 * added cvs log comments
 *
 */
 
/**
 * This class is the glue that binds the controls on the physical operator
 * interface to the commands and command groups that allow control of the robot.
 */
public class OI {
    //// CREATING BUTTONS
    // One type of button is a joystick button which is any button on a joystick.
    // You create one by telling it which joystick it's on and which button
    // number it is.
    // Joystick stick = new Joystick(port);
    // Button button = new JoystickButton(stick, buttonNumber);
    
    // Another type of button you can create is a DigitalIOButton, which is
    // a button or switch hooked up to the cypress module. These are useful if
    // you want to build a customized operator interface.
    // Button button = new DigitalIOButton(1);
    
    // There are a few additional built in buttons you can use. Additionally,
    // by subclassing Button you can create custom triggers and bind those to
    // commands the same as any other Button.
    
    //// TRIGGERING COMMANDS WITH BUTTONS
    // Once you have a button, it's trivial to bind it to a button in one of
    // three ways:
    
    // Start the command when the button is pressed and let it run the command
    // until it is finished as determined by it's isFinished method.
    // button.whenPressed(new ExampleCommand());
    
    // Run the command while the button is being held down and interrupt it once
    // the button is released.
    // button.whileHeld(new ExampleCommand());
    
    // Start the command when the button is released  and let it run the command
    // until it is finished as determined by it's isFinished method.
    // button.whenReleased(new ExampleCommand());
    
    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS
    public JoystickButton shiftHighButton;
    public Joystick leftJoystick;
    public JoystickButton shiftLowButton;
    public Joystick rightJoystick;
    public JoystickButton pickupDownButton;
    public JoystickButton pickupUpButton;
    public JoystickButton shootButton;
    public JoystickButton shootHighButton;
    public JoystickButton shootLowButton;
    public JoystickButton armClimbingButton;
    public JoystickButton frisbeePickupOffButton;
    public JoystickButton frisbeePickupOnButton;
    public JoystickButton slowFrisbeePickupButton;
    public JoystickButton reversePickupButton;
    public Joystick operatorJoystick;
    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS
    public OI() {
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
        operatorJoystick = new Joystick(3);
        
        reversePickupButton = new JoystickButton(operatorJoystick, 10);
        reversePickupButton.whenPressed(new ReversePickup());
        slowFrisbeePickupButton = new JoystickButton(operatorJoystick, 3);
        slowFrisbeePickupButton.whenPressed(new SlowPickupFrisbees());
        frisbeePickupOnButton = new JoystickButton(operatorJoystick, 9);
        frisbeePickupOnButton.whenPressed(new PickupFrisbeesOn());
        frisbeePickupOffButton = new JoystickButton(operatorJoystick, 8);
        frisbeePickupOffButton.whenPressed(new PickupFrisbeesOff());
        armClimbingButton = new JoystickButton(operatorJoystick, 5);
        armClimbingButton.whenPressed(new ArmClimbing());
        shootLowButton = new JoystickButton(operatorJoystick, 2);
        shootLowButton.whenPressed(new ArmLowShooting());
        shootHighButton = new JoystickButton(operatorJoystick, 4);
        shootHighButton.whenPressed(new ArmHighShooting());
        shootButton = new JoystickButton(operatorJoystick, 1);
        shootButton.whenPressed(new LaunchFrisbee());
        pickupUpButton = new JoystickButton(operatorJoystick, 6);
        pickupUpButton.whenPressed(new PickupUp());
        pickupDownButton = new JoystickButton(operatorJoystick, 7);
        pickupDownButton.whenPressed(new PickupDown());
        rightJoystick = new Joystick(2);
        
        shiftLowButton = new JoystickButton(rightJoystick, 1);
        shiftLowButton.whenPressed(new ShiftLow());
        leftJoystick = new Joystick(1);
        
        shiftHighButton = new JoystickButton(leftJoystick, 1);
        shiftHighButton.whenPressed(new ShiftHigh());
	    
        // SmartDashboard Buttons
        SmartDashboard.putData("AutonomousCommand", new AutonomousCommand());
        SmartDashboard.putData("ShiftHigh", new ShiftHigh());
        SmartDashboard.putData("ShiftLow", new ShiftLow());
        SmartDashboard.putData("MarsRock", new MarsRock());
        SmartDashboard.putData("PickupDown", new PickupDown());
        SmartDashboard.putData("PickupUp", new PickupUp());
        SmartDashboard.putData("LaunchFrisbee", new LaunchFrisbee());
        SmartDashboard.putData("ShootHigh", new ShootHigh());
        SmartDashboard.putData("ShootLow", new ShootLow());
        SmartDashboard.putData("PickupFrisbees", new PickupFrisbees());
        SmartDashboard.putData("PickupFrisbeesOn", new PickupFrisbeesOn());
        SmartDashboard.putData("PickupFrisbeesOff", new PickupFrisbeesOff());
        SmartDashboard.putData("ReversePickup", new ReversePickup());
        SmartDashboard.putData("SlowPickupFrisbees", new SlowPickupFrisbees());
        SmartDashboard.putData("ArmLowShooting", new ArmLowShooting());
        SmartDashboard.putData("ArmHighShooting", new ArmHighShooting());
        SmartDashboard.putData("ArmClimbing", new ArmClimbing());
        SmartDashboard.putData("StopShootHigh", new StopShootHigh());
        SmartDashboard.putData("StopShootLow", new StopShootLow());
        SmartDashboard.putData("ControlLEDs", new ControlLEDs());
        SmartDashboard.putData("TurnCamera", new TurnCamera());
        SmartDashboard.putData("TurnCameraIterative", new TurnCameraIterative());
        SmartDashboard.putData("ArmLowPickup", new ArmLowPickup());
        SmartDashboard.putData("SetArmZero", new SetArmZero());
    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    }
    
    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=FUNCTIONS
    public Joystick getLeftJoystick() {
        return leftJoystick;
    }
    public Joystick getRightJoystick() {
        return rightJoystick;
    }
    public Joystick getOperatorJoystick() {
        return operatorJoystick;
    }
    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=FUNCTIONS
}

@@ -755,16 +755,88 @@
 ava,v $%0A
+ * Revision 1.19  2013-03-17 01:57:22  jdavid%0A * Added pickup sensor%0A *%0A
  * Revis
@@ -4014,34 +4014,38 @@
 d(new Pickup
-FrisbeesOn
+OnCommandGroup
 ());%0A       
@@ -4408,38 +4408,44 @@
 Pressed(new 
-ArmLowShooting
+ShootLowCommandGroup
 ());%0A       
@@ -6936,24 +6936,108 @@
 ArmZero());%0A
+        SmartDashboard.putData(%22PickupOnCommandGroup%22, new PickupOnCommandGroup());%0A
     // END A

use command group for shooting and pickup on