Example #1
0
  public int getPostion() throws DriverStationEnhancedIO.EnhancedIOException {

    if (ds.getAnalogIn(1) < RobotMap.shooterVDposition0) {
      position = 1;
    }
    // If Station Knob is at
    else if (ds.getAnalogIn(1) >= RobotMap.shooterVDposition1
        && ds.getAnalogIn(1) < RobotMap.shooterVDposition1 + .3) {
      position = 2;
    }
    // If Station Knob is at
    else if (ds.getAnalogIn(1) >= RobotMap.shooterVDposition2
        && ds.getAnalogIn(1) < RobotMap.shooterVDposition2 + .2) {
      position = 3;
    }
    // If Station Knob is at
    else if (ds.getAnalogIn(1) >= RobotMap.shooterVDposition3
        && ds.getAnalogIn(1) < RobotMap.shooterVDposition3 + .3) {
      position = 4;
    }
    // If Station Knob is at
    else if (ds.getAnalogIn(1) >= RobotMap.shooterVDposition4
        && ds.getAnalogIn(1) < RobotMap.shooterVDposition4 + .3) {
      position = 5;
    }
    // If Station Knob is at
    else if (ds.getAnalogIn(1) >= RobotMap.shooterVDposition5) {
      position = 6;
    }
    return position;
  }
Example #2
0
 public int getLiftPoition() throws DriverStationEnhancedIO.EnhancedIOException {
   if (ds.getAnalogIn(2) < RobotMap.liftVDposition1) {
     liftPosition = 1;
   } else if (ds.getAnalogIn(2) < RobotMap.liftVDposition2) {
     liftPosition = 2;
   } else if (ds.getAnalogIn(2) < RobotMap.liftVDposition3) {
     liftPosition = 3;
   } else {
     liftPosition = 4;
   }
   return liftPosition;
 }
Example #3
0
 public double getDelayPot() {
   try {
     return getMaxVoltage() - enhancedIO.getAnalogIn(DELAY_POT_CHANNEL);
   } catch (EnhancedIOException ex) {
     return 0.0;
   }
 }
Example #4
0
 public double getSpeedPot() {
   try {
     return getMaxVoltage() - enhancedIO.getAnalogIn(SPEED_TRIM_POT_CHANNEL);
   } catch (EnhancedIOException ex) {
     return 0.0;
   }
 }
Example #5
0
 public double getMaxVoltage() {
   try {
     return enhancedIO.getAnalogIn(MAX_ANALOG_CHANNEL);
   } catch (EnhancedIOException e) {
     return 2.2;
   }
 }
Example #6
0
 public double getRawAnalogVoltage() {
   try {
     return enhancedIO.getAnalogIn(DISTANCE_BUTTONS_CHANNEL);
   } catch (EnhancedIOException e) {
     return 0;
   }
 }