@Test public void setPulseDurationRange() throws IOException { Servo servo = new Servo(mPwm); final double minPulse = 5, maxPulse = 10; servo.setPulseDurationRange(minPulse, maxPulse); assertEquals(minPulse, servo.getMinimumPulseDuration(), EPSILON); assertEquals(maxPulse, servo.getMaximumPulseDuration(), EPSILON); }
public void setPulseDurationRange(double minMs, double maxMs) throws IOException { if (minMs >= maxMs) { throw new IllegalArgumentException("minMs must be less than maxMs"); } if (minMs < 0) { throw new IllegalArgumentException("minMs must be greater than 0"); } mMinPulseDuration = minMs; mMaxPulseDuration = maxMs; updateDutyCycle(); }
Servo implements AutoCloseable { public void setPulseDurationRange(double minMs, double maxMs) throws IOException { if (minMs >= maxMs) { throw new IllegalArgumentException("minMs must be less than maxMs"); } if (minMs < 0) { throw new IllegalArgumentException("minMs must be greater than 0"); } mMinPulseDuration = minMs; mMaxPulseDuration = maxMs; updateDutyCycle(); } }
Servo implements AutoCloseable { public void setPulseDurationRange(double minMs, double maxMs) throws IOException { if (minMs >= maxMs) { throw new IllegalArgumentException("minMs must be less than maxMs"); } if (minMs < 0) { throw new IllegalArgumentException("minMs must be greater than 0"); } mMinPulseDuration = minMs; mMaxPulseDuration = maxMs; updateDutyCycle(); } Servo(String pin);  Servo(String pin, double frequencyHz); @VisibleForTesting  Servo(Pwm device); @VisibleForTesting  Servo(Pwm device, double frequencyHz); }
Servo implements AutoCloseable { public void setPulseDurationRange(double minMs, double maxMs) throws IOException { if (minMs >= maxMs) { throw new IllegalArgumentException("minMs must be less than maxMs"); } if (minMs < 0) { throw new IllegalArgumentException("minMs must be greater than 0"); } mMinPulseDuration = minMs; mMaxPulseDuration = maxMs; updateDutyCycle(); } Servo(String pin);  Servo(String pin, double frequencyHz); @VisibleForTesting  Servo(Pwm device); @VisibleForTesting  Servo(Pwm device, double frequencyHz); @Override void close(); void setEnabled(boolean enabled); void setPulseDurationRange(double minMs, double maxMs); double getMinimumPulseDuration(); double getMaximumPulseDuration(); void setAngleRange(double minAngle, double maxAngle); double getMinimumAngle(); double getMaximumAngle(); void setAngle(double angle); double getAngle(); }
Servo implements AutoCloseable { public void setPulseDurationRange(double minMs, double maxMs) throws IOException { if (minMs >= maxMs) { throw new IllegalArgumentException("minMs must be less than maxMs"); } if (minMs < 0) { throw new IllegalArgumentException("minMs must be greater than 0"); } mMinPulseDuration = minMs; mMaxPulseDuration = maxMs; updateDutyCycle(); } Servo(String pin);  Servo(String pin, double frequencyHz); @VisibleForTesting  Servo(Pwm device); @VisibleForTesting  Servo(Pwm device, double frequencyHz); @Override void close(); void setEnabled(boolean enabled); void setPulseDurationRange(double minMs, double maxMs); double getMinimumPulseDuration(); double getMaximumPulseDuration(); void setAngleRange(double minAngle, double maxAngle); double getMinimumAngle(); double getMaximumAngle(); void setAngle(double angle); double getAngle(); static final double DEFAULT_FREQUENCY_HZ; }