diff --git a/libraries/Servo/src/Servo.cpp b/libraries/Servo/src/Servo.cpp index 69ed476d84..1d19f62683 100644 --- a/libraries/Servo/src/Servo.cpp +++ b/libraries/Servo/src/Servo.cpp @@ -58,7 +58,7 @@ Servo::~Servo() { uint8_t Servo::attach(int pin) { - return attach(pin, DEFAULT_MIN_PULSE_WIDTH, DEFAULT_MAX_PULSE_WIDTH); + return attach(pin, _minUs, _maxUs); } uint8_t Servo::attach(int pin, uint16_t minUs, uint16_t maxUs) @@ -94,7 +94,6 @@ void Servo::detach() delay(REFRESH_INTERVAL / 1000); // long enough to complete active period under all circumstances. stopWaveform(_pin); _attached = false; - _valueUs = DEFAULT_NEUTRAL_PULSE_WIDTH; } } diff --git a/libraries/Servo/src/Servo.h b/libraries/Servo/src/Servo.h index 9efb7b2c0d..d40939c2aa 100644 --- a/libraries/Servo/src/Servo.h +++ b/libraries/Servo/src/Servo.h @@ -29,7 +29,8 @@ // // attach(pin) - Attaches a servo motor to an i/o pin. // attach(pin, min, max) - Attaches to a pin setting min and max values in microseconds -// default min is 1000, max is 2000 +// attach(pin, min, max, value) - Attaches to a pin setting min, max, and current values in microseconds +// default min is 1000, max is 2000, and value is 1500. // // write() - Sets the servo angle in degrees. (invalid angle that is valid as pulse in microseconds is treated as microseconds) // writeMicroseconds() - Sets the servo pulse width in microseconds