1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-06 05:21:22 +03:00

Merge pull request #840 from chrisfraser/esp8266

Fix to Servo allowing write() to be called before attach()
This commit is contained in:
Ivan Grokhotkov 2015-09-30 22:48:32 +03:00
commit b81fb95b24

View File

@ -146,6 +146,10 @@ Servo::Servo()
_servoIndex = s_servoCount++;
// store default values
s_servos[_servoIndex].usPulse = DEFAULT_PULSE_WIDTH;
// set default _minUs and _maxUs incase write() is called before attach()
_minUs = MIN_PULSE_WIDTH;
_maxUs = MAX_PULSE_WIDTH;
}
else {
_servoIndex = INVALID_SERVO; // too many servos