package com.edinarobotics.zed;

import com.edinarobotics.utils.gamepad.Gamepad;

/**
 * Controls handles creating the {@link Gamepad} objects
 * used to control the robot as well as binding the proper Commands
 * to button actions.
 */
public class Controls {
    private static Controls instance;
    
    public final Gamepad gamepad1;
    public final Gamepad gamepad2;
    
    private Controls(){
        gamepad1 = new Gamepad(1);
        gamepad2 = new Gamepad(2);
    }
    
    /**
     * Returns the proper instance of Controls.
     * This method creates a new Controls object the first time it is called
     * and returns that object for each subsequent call.
     * @return The current instance of Controls.
     */
    public static Controls getInstance(){
        if(instance == null){
            instance = new Controls();
        }
        return instance;
    }
}

@@ -72,16 +72,158 @@
 Gamepad;
+%0Aimport com.edinarobotics.zed.commands.*;%0Aimport com.edinarobotics.zed.subsystems.Collector;%0Aimport com.edinarobotics.zed.subsystems.Conveyor;
 %0A%0A/**%0A *
@@ -429,24 +429,84 @@
 s instance;%0A
+    private static final double ONE_JOYSTICK_MAGNITUDE = 1;%0A
     %0A    pub
@@ -593,24 +593,24 @@
 Controls()%7B%0A
-
         game
@@ -632,16 +632,1515 @@
 pad(1);%0A
+        //Conveyor%0A        gamepad1.LEFT_TRIGGER.whenPressed(new SetConveyorCommand(Conveyor.CONVEYOR_IN));%0A        gamepad1.LEFT_TRIGGER.whenReleased(new SetConveyorCommand(Conveyor.CONVEYOR_STOP));%0A        gamepad1.LEFT_BUMPER.whenPressed(new SetConveyorCommand(Conveyor.CONVEYOR_OUT));%0A        gamepad1.LEFT_BUMPER.whenReleased(new SetConveyorCommand(Conveyor.CONVEYOR_STOP));%0A        //Collector%0A        gamepad1.RIGHT_TRIGGER.whenPressed(new SetCollectorCommand(Collector.COLLECTOR_IN));%0A        gamepad1.RIGHT_TRIGGER.whenReleased(new SetCollectorCommand(Collector.COLLECTOR_STOP));%0A        gamepad1.RIGHT_BUMPER.whenPressed(new SetCollectorCommand(Collector.COLLECTOR_OUT));%0A        gamepad1.RIGHT_BUMPER.whenReleased(new SetCollectorCommand(Collector.COLLECTOR_STOP));%0A        //One-Joystick Strafe%0A        gamepad1.DPAD_UP.whileHeld(new SetDrivetrainCommand(ONE_JOYSTICK_MAGNITUDE, 0, 0));%0A        gamepad1.DPAD_UP.whenReleased(new SetDrivetrainCommand(0, 0, 0));%0A        gamepad1.DPAD_DOWN.whileHeld(new SetDrivetrainCommand(ONE_JOYSTICK_MAGNITUDE, 180, 0));%0A        gamepad1.DPAD_DOWN.whenReleased(new SetDrivetrainCommand(0, 0, 0));%0A        gamepad1.DPAD_LEFT.whileHeld(new SetDrivetrainCommand(ONE_JOYSTICK_MAGNITUDE, -90, 0));%0A        gamepad1.DPAD_LEFT.whenReleased(new SetDrivetrainCommand(0, 0, 0));%0A        gamepad1.DPAD_RIGHT.whileHeld(new SetDrivetrainCommand(ONE_JOYSTICK_MAGNITUDE, 90, 0));%0A        gamepad1.DPAD_RIGHT.whenReleased(new SetDrivetrainCommand(0, 0, 0));%0A        %0A
         

Add preliminary controls to the gamepad buttons.