protected void checkState() {
   if (solenoid.get()) {
     direction = Direction.EXTENDING;
   } else if (!solenoid.get()) {
     direction = Direction.RETRACTING;
   }
 }
 public void setSuckingLED() {
   if (sol4.get() == false && sol5.get() == true) {
     suckingLED.set(true);
   } else {
     suckingLED.set(false);
   }
 }
  public void teleopPeriodic() {
    smart.putNumber("distance", ultrasonic.getVoltage());
    setSuckingLED();
    setLEDTeamColour();

    // smart dashboard stuff
    smart.putBoolean("Fully Pressurized", compressor.getPressureSwitchValue());

    smart.putBoolean("fast gear", sol1.get() == true && sol2.get() == false);
    smart.putBoolean("slow gear", sol1.get() == false && sol2.get() == true);

    if (gyro.getAngle() > 360 || gyro.getAngle() < -360) {
      gyro.reset();
    }
    smart.putBoolean("good angle", gyro.getAngle() < 30 && gyro.getAngle() > -30);
    smart.putBoolean(
        "too far right", (gyro.getAngle() > 30 && gyro.getAngle() < 180) || gyro.getAngle() < -180);
    smart.putBoolean(
        "too far left", (gyro.getAngle() < -30 && gyro.getAngle() > -180) || gyro.getAngle() > 180);

    if (ultrasonic.getVoltage() < 0.55) {
      tooClose = true;
    } else {
      tooClose = false;
    }
    smart.putBoolean("Too close", tooClose);

    if (ultrasonic.getVoltage() > 0.8) {
      tooFar = true;
    } else {
      tooFar = false;
    }
    smart.putBoolean("Too far", tooFar);

    if (ultrasonic.getVoltage() >= 0.55 && ultrasonic.getVoltage() <= 0.8) {
      inRange = true;
    } else {
      inRange = false;
    }
    smart.putBoolean("In range", inRange);
  }
Exemplo n.º 4
0
  public boolean getUp() {
    if (m_bDefaultStat) return !m_solUp.get();

    return m_solUp.get();
  }
 public boolean getState() {
   return collectorArms.get();
 }
 public static boolean isDown() {
   return hooks.get() == false;
 }
 public static boolean isUp() {
   return hooks.get() == true;
 }
 public static boolean get() {
   return hooks.get();
 }
Exemplo n.º 9
0
 public boolean getHangerPosition() {
   return left.get();
 }
Exemplo n.º 10
0
 public boolean isExtended() {
   return solenoidExtend.get();
 }