* The default timings were chosen vastly outside specification. On COTS servos, this causes much confusion for the user, because a wide range of angle starting from 0 degress, and a just a large range of angle leading up to 180 degrees, is dead - in fact, the servo doesn't move at all, from any position.
Not investigated further for obvious reasons, as this may have also destroyed servos that ran hot trying to abide by the PWM signal but could not mechanically!
* Change timing limits to safe values. With previous default timings and safety limits, popular servos
could force against internal physical endstops, which could overload and destroy them.
* Review action: revert changes to hard boundary for min/max duty cycle timings. Internal review, fix/drop legacy comments.
* A Servo on each available ESP8266 GPIO (D0-D8), no observed interference.
* Remove possible jerk due to force-cancelling duty cycle.
* Overload attach: can specify initial angle for servo, too.
* Stricter checks for configured, and default, bounded timings.
* Missed the min/max in a comment.
* Default microsecond lower bound of 1000 causes confusing behavior - 200 is minimum enforced elsewhere, so use it here too as nearest multiple of 100 from 180.
* Comment rationale for changed defaults of min/max pulse widths.
Comment rationale for changed defaults of min/max pulse widths.
Fix/clarify comments.
Fix redundancies in Tone, end Tone waveform on exact period limit for proper sound.
Fix redundancies in wiring_pwmExtend Servo to map in-use pins, Tone already has this.
Remove and rewrite all the parts of the core/libraries using TIMER1
and consolidate into a single, shared waveform generation interrupt
structure. Tone, analogWrite(), Servo all now just call into this
shared resource to perform their tasks so are all compatible
and can be used simultaneously.
This setup enables multiple tones, analogWrites, servos, and stepper
motors to be controlled with reasonable accuracy. It uses both TIMER1
and the internal ESP cycle counter to handle timing of waveform edges.
TIMER1 is used in non-reload mode and only edges cause interrupts. The
interrupt is started and stopped as required, minimizing overhead when
these features are not being used.
A generic "startWaveform(pin, high-US, low-US, runtime-US)" and
"stopWaveform(pin)" allow for further types of interfaces. Minimum
high or low period is ~1 us.
Add a tone(float) method, useful when working with lower frequencies.
Fixes#4321. Fixes 4349.
This exposes the Timer0
This provides a Servo library support compatible with Arduino Servo
library but only supports the two timers the esp8266 has available