daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Mar 26th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (Robot.m_oi.getDpadGame() == 0) {
  2.       Robot.m_oi.gameJoyStick.setRumble(RumbleType.kRightRumble, 1);
  3.       Timer.delay(0.25);  
  4.       Robot.m_oi.gameJoyStick.setRumble(RumbleType.kRightRumble, 0);
  5.       Mode = 3;
  6.     }
  7.     else if (Robot.m_oi.getDpadGame() == 90) {
  8.       Robot.m_oi.gameJoyStick.setRumble(RumbleType.kRightRumble, 1);
  9.       Timer.delay(0.25);  
  10.       Robot.m_oi.gameJoyStick.setRumble(RumbleType.kRightRumble, 0);
  11.       Mode = 1;
  12.     }
  13.     else if (Robot.m_oi.getDpadGame() == 180) {
  14.       Robot.m_oi.gameJoyStick.setRumble(RumbleType.kRightRumble, 1);
  15.       Timer.delay(0.25);  
  16.       Robot.m_oi.gameJoyStick.setRumble(RumbleType.kRightRumble, 0);
  17.       Mode = 2;
  18.     }
  19.    else if (Robot.m_oi.getDpadGame() == 270) {
  20.       Robot.m_oi.gameJoyStick.setRumble(RumbleType.kRightRumble, 1);
  21.       Timer.delay(0.25);  
  22.       Robot.m_oi.gameJoyStick.setRumble(RumbleType.kRightRumble, 0);
  23.       Mode = 4;
  24.     }
  25.  
  26.     if (Mode == 1) {
  27.       //climb
  28.       if (Robot.m_oi.gameJoyStick.getAButtonPressed()) {
  29.         System.out.println("A mode 1");
  30.         Scheduler.getInstance().add(new PneumaticsToggleCommand(1, !fs));
  31.       }
  32.       if (Robot.m_oi.gameJoyStick.getXButtonPressed()) {
  33.         System.out.println("X mode 1");
  34.         Scheduler.getInstance().add(new PneumaticsToggleCommand(2, !as));
  35.       }
  36.       if (Robot.m_oi.gameJoyStick.getBButtonPressed()) {
  37.         System.out.println("B mode 1");
  38.         Scheduler.getInstance().add(new PneumaticsToggleCommand(3, !bs));
  39.       }
  40.       if (Robot.m_oi.gameJoyStick.getYButtonPressed()) {
  41.         System.out.println("Y mode 1");
  42.         Scheduler.getInstance().add(new PneumaticsToggleCommand(1, !fs));
  43.         Scheduler.getInstance().add(new PneumaticsToggleCommand(3, !bs));
  44.       }
  45.       if (Robot.m_oi.gameJoyStick.getBumper(Hand.kRight)) {
  46.         System.out.println("Bumper mode 1");
  47.         Scheduler.getInstance().add(new PneumaticsToggleCommand(5, !hs));
  48.       }
  49.       while (Robot.m_oi.getGameTriggerDrive() != 0)
  50.       {
  51.       //  WPI_TalonSRX rearstrut = new WPI_TalonSRX(RobotMap.strutback);
  52.       //  rearstrut.set(-Robot.m_oi.getGameTriggerDrive());
  53.       }
  54.     }
  55.     else if (Mode == 3) {
  56.       //ball
  57.       if (Robot.m_oi.gameJoyStick.getAButtonPressed()) {
  58.         System.out.println("A mode 3");
  59.         Scheduler.getInstance().add(new BallFloor());
  60.       }
  61.       if (Robot.m_oi.gameJoyStick.getBButtonPressed()) {
  62.         System.out.println("B mode 3");
  63.         Scheduler.getInstance().add(new BallLVL1());
  64.       }
  65.       if (Robot.m_oi.gameJoyStick.getYButtonPressed()) {
  66.         System.out.println("Y mode 3");
  67.         Scheduler.getInstance().add(new BallLVL2());
  68.       }
  69.       if (Robot.m_oi.gameJoyStick.getXButtonPressed()) {
  70.         System.out.println("X mode 3");
  71.         Scheduler.getInstance().add(new BallLVL3());
  72.       }
  73.       if (Robot.m_oi.gameJoyStick.getBumperPressed(Hand.kRight)) {
  74.         System.out.println("Right Bumper mode 3");
  75.         Scheduler.getInstance().add(new BallCargoShip());
  76.       }
  77.       if(Robot.m_oi.gameJoyStick.getBumperPressed(Hand.kLeft)) {
  78.         System.out.println("Left Bumper mode 3");
  79.         Scheduler.getInstance().add(new PneumaticsToggleCommand(2, !as));
  80.       }
  81.       if(Robot.m_oi.gameJoyStick.getStickButtonPressed(Hand.kLeft)) {
  82.         System.out.println("Left Stick Pressed");
  83.         Scheduler.getInstance().add(new PneumaticsToggleCommand(4, !ws));
  84.       }
  85.       if (Robot.m_oi.gameJoyStick.getY(Hand.kRight) != 0)
  86.       {
  87.         elevator.set(Robot.m_oi.gameJoyStick.getY(Hand.kRight));
  88.       }
  89.      
  90.         intake.set(Robot.m_oi.getGameTriggerDrive());
  91.      
  92.     }
  93.     else if (Mode == 2) {
  94.       //hatch
  95.       if (Robot.m_oi.gameJoyStick.getAButtonPressed()) {
  96.         System.out.println("A mode 2");
  97.         Scheduler.getInstance().add(new HatchLVLFloor());
  98.       }
  99.       if (Robot.m_oi.gameJoyStick.getBButtonPressed()) {
  100.         System.out.println("B mode 2");
  101.         Scheduler.getInstance().add(new HatchLVL1());
  102.       }
  103.       if (Robot.m_oi.gameJoyStick.getXButtonPressed()) {
  104.         System.out.println("X mode 2");
  105.         Scheduler.getInstance().add(new HatchLVL2());
  106.       }
  107.       if (Robot.m_oi.gameJoyStick.getYButtonPressed()) {
  108.         System.out.println("Y mode 2");
  109.         Scheduler.getInstance().add(new HatchLVL3());
  110.       }
  111.       if(Robot.m_oi.gameJoyStick.getBumperPressed(Hand.kLeft)) {
  112.         System.out.println("Left Bumper mode 3");
  113.         Scheduler.getInstance().add(new PneumaticsToggleCommand(2, !as));
  114.       }
  115.       if(Robot.m_oi.gameJoyStick.getStickButtonPressed(Hand.kLeft)) {
  116.         System.out.println("Left Stick Pressed");
  117.         Scheduler.getInstance().add(new PneumaticsToggleCommand(4, !ws));
  118.       }
  119.       if (Robot.m_oi.gameJoyStick.getY(Hand.kRight) != 0)
  120.       {
  121.         elevator.set(Robot.m_oi.gameJoyStick.getY(Hand.kRight));
  122.       }
  123.       if (Robot.m_oi.getGameTriggerDrive() != 0)
  124.       {
  125.         intake.set(Robot.m_oi.getGameTriggerDrive());
  126.       }
  127.     }
  128.     else if (Mode == 4)
  129.     {
  130.     //debug
  131.     if (Robot.m_oi.gameJoyStick.getAButtonPressed()) {
  132.       System.out.println("A mode 4");
  133.       Scheduler.getInstance().add(new PneumaticsToggleCommand(1, !fs));
  134.     }
  135.     if (Robot.m_oi.gameJoyStick.getXButtonPressed()) {
  136.       System.out.println("X mode 4");
  137.     }
  138.     if (Robot.m_oi.gameJoyStick.getBButtonPressed()) {
  139.       System.out.println("B mode 4");
  140.       Scheduler.getInstance().add(new PneumaticsToggleCommand(3, !bs));
  141.     }
  142.     if (Robot.m_oi.gameJoyStick.getYButtonPressed()) {
  143.       System.out.println("Y mode 4");
  144.     }
  145.     if(Robot.m_oi.gameJoyStick.getBumperPressed(Hand.kLeft)) {
  146.       System.out.println("Left Bumper mode 3");
  147.       Scheduler.getInstance().add(new PneumaticsToggleCommand(2, !as));
  148.     }
  149.     if(Robot.m_oi.gameJoyStick.getStickButtonPressed(Hand.kLeft)) {
  150.       System.out.println("Left Stick Pressed");
  151.       Scheduler.getInstance().add(new PneumaticsToggleCommand(4, !ws));
  152.     }
  153.     if (Robot.m_oi.gameJoyStick.getY(Hand.kRight) != 0)
  154.     {
  155.       elevator.set(Robot.m_oi.gameJoyStick.getY(Hand.kRight));
  156.     }
  157.     if (Robot.m_oi.getGameTriggerDrive() != 0)
  158.     {
  159.       intake.set(Robot.m_oi.getGameTriggerDrive());
  160.     }
  161.    }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top