mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-25 20:02:37 +03:00
Fix to Servo allowing write() to be called before attach()
This commit is contained in:
parent
1bc87e7bff
commit
d92f2f375e
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user