コード例 #1
0
  /**
   * This method sets the voltage for all the D-Bug Speed Controllers you've added.
   *
   * @param v The voltage (velocity) to set for all the D-Bug Speed Controllers you've added.
   * @return A boolean of the process success - true if it succeeded or false if it failed.
   */
  public boolean setMotors(double v) {
    boolean ok = true;

    for (DBugSpeedController d : controllers) {
      if (!d.setMotor(v)) {
        ok = false;
        break;
      }
    }

    if (!ok) {
      for (DBugSpeedController d : controllers) {
        d.setMotor(0);
      }

      logger.severe(this.getName() + " is burning to the ground");

      return false;
    }

    return true;
  }
コード例 #2
0
 public double getCurrent() {
   return intakeMotor.getCurrent();
 }