Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By SomeOneASDF
#62960 HI

i have a esp8266 and i2c pwm servo ic

i went to servo rotate slowly, so i change pwm value every 10ms

but if there is a http request coming

the servo loop will be break , servo look lag

handleClient() need about 100ms to finish

how can i do make the servo smooth rotate and recv data from http service??




i have tried async web server, but the server still will break servo control loop

can i have a high priority interrupt pause the web server a little time to update pwm??
User avatar
By mrburnette
#63060 The design of the ESP8266 under Arduino sets up two task using the non-OS task switcher.
http://bbs.espressif.com/viewtopic.php?t=838

The Arduino code MUST relinquish control or the RF section will "starve" and the WDT will force a reset. Documentation is contradictory but the refresh seems to be in the range of 30-50mS ... see delay(0) and yield().

You will need to design your Arduino code to manage dark periods. The top of loop() always passes control to switch tasks. The delay(0) and yield() are to be used inside the loop() control structure if the loop() cannot be cycled in the required time.

The answer is Arduino running on the 2-core ESP32 ... just not fully baked, yet.

Ray