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

Moderator: igrr

User avatar
By helpme
#53281 Adding yield() will reduce random resets. Sometimes, for the sake of stability, one can have too many yield() in the code. What is the side effect of having too many yield() in the code?
User avatar
By mrburnette
#53589
helpme wrote:Adding yield() will reduce random resets. Sometimes, for the sake of stability, one can have too many yield() in the code. What is the side effect of having too many yield() in the code?


A delay(0) is executed at the repetition of every loop() and in a simple program that means thousands of calls into the backend where yield() lives. There is no issues with this approach ...

But, IMO, what you should be doing is using millis() to benchmark your code to determine where you actually needs the delay(0) or yield(). Profiling your code is something you should be doing anyway to get an impression of what is eating time in your loop. I have an example here.


Ray