예제 #1
0
 @Override
 protected void end() {
   timer1.stop();
   shooterWheel.rawShoot(0);
   shooterBar.rawBallPush(0);
   System.out.println("Shoot End");
 }
예제 #2
0
  /*
   * reads the value of the digital input of the specified channel
   * requires that the readArudiono() method has already been called
   * param 1: the channel to be read
   * return: value of the specified digital input
   */
  public boolean getInput(int channelID) {
    byte temp;

    if (timer.get() > 2.0) {
      DriverStationLCD.getInstance()
          .println(DriverStationLCD.Line.kUser3, 1, "                     ");
      DriverStationLCD.getInstance().updateLCD();
      timer.stop();
      timer.reset();
    }

    if (Math.abs(channelID - (13 / 2)) - (13 / 2)
        > 0) // returns true if less than zero or greater than thirteen
    {
      timer.start();
      DriverStationLCD.getInstance().println(DriverStationLCD.Line.kUser3, 1, "Invalid ID");
      DriverStationLCD.getInstance().updateLCD();
      return false;
    } else if (channelID < 8) {
      temp = (byte) (loByte & (1 << channelID));
      return temp != 0;
    } else {
      temp = (byte) (hiByte & (1 << channelID - 8));
      return temp != 0;
    }
  }
  public DriveForwardForTime(double numberOfSeconds, double speed) {

    requires(Chassis.getInstance());
    this.numberOfSeconds = numberOfSeconds;
    timer = new Timer();
    timer.stop();
    this.speed = speed;
  }
예제 #4
0
 /** Resets the recorder so we can record properly next time */
 public void reset() {
   if (m_bRecStarted) {
     writeDataToFile();
     m_List.removeAllElements();
     m_Index = 0;
     m_tmRecorder.stop();
     m_tmRecorder.reset();
     m_bRecDone = false;
     m_bRecStarted = false;
   }
 }
예제 #5
0
 private double m_shoot() {
   if (encoder.get() >= desired || shootTime.get() > m_timeToShoot) {
     shooting = false;
     retracting = true;
     shootTime.stop();
     retractTime.start();
     retractTime.reset();
     return .1;
   } else { // encoder < desired && shootTime < 0.2
     error = desired - encoder.get();
     return -1;
   }
 }
예제 #6
0
  /**
   * Records bots movements to specified file
   *
   * @param sFileName
   */
  public void record(String sFileName) {
    if (!m_bRecStarted) {
      m_sFile = sFileName;
      m_tmRecorder.start();
      m_bRecStarted = true;
    }

    if (!m_bRecDone) {
      m_Index++;
      m_botDataAuto = new BotData();
      m_botDataAuto.setValues(m_tmRecorder.get(), m_bot);
      m_List.addElement(m_botDataAuto);
    } else {
      Vars.fnDisableDrive();
      m_bot.stopRobot();
      m_tmRecorder.stop();
      m_tmRecorder.reset();
    }
  }
예제 #7
0
 protected void end() {
   _timer.stop();
 }
예제 #8
0
 @Override
 protected void end() {
   timer.stop();
 }
예제 #9
0
 // Called once after isFinished returns true
 protected void end() {
   timer.stop();
   intake.stop();
 }
예제 #10
0
 protected void end() {
   pidControllerDistance.disable();
   drivetrainStrafe.mecanumPolarStrafe(0, 0);
   drivetrainRotation.mecanumPolarRotate(0);
   timer.stop();
 }
예제 #11
0
 public static void Reinit() {
   timer.stop();
   timer.reset();
   timer.start();
 }