Servo library sketch
Posted: Sat Apr 04, 2015 7:50 am
I have some Arduino projects which are using an ESP8266-modem but which now can run on the ESP8266 itself! I love this new platform and many things work like a charm. One of my projects is using servos as mechanical drives which are not yet supported. I eventually found a way to make them work using the Ticker-library. Attached is the example sketch together with some code that shows how this is done using software PWM. Usage is identical to the Arduino library. It is very simple and I apologize for that but the original library is far beyond my C++ skills. Having said that this code works well. What I tried:
* one and two servos at different pins / speeds
* servo driven via WLAN
Both seemed to work fine with no jitter. Notice though that every servo blocks roughly 10% of the CPU time.
* one and two servos at different pins / speeds
* servo driven via WLAN
Both seemed to work fine with no jitter. Notice though that every servo blocks roughly 10% of the CPU time.