Closed mfgarvin closed 1 year ago
I'm not 100% sure I'm reading this for loop correctly, but you might want to make this sleep statement happen every iteration. Otherwise this check will just run as fast as it can
Good catch - that's one thread fixed
Here's the other problematic bit. Not sure why, but something about these calculations is pretty cpu intensive. https://github.com/mfgarvin/DOC_Mapboard/blob/6dbc3f77fe96b524d9aded373e7a27580ea0be55/main.py#L357-L362 https://github.com/mfgarvin/DOC_Mapboard/blob/6dbc3f77fe96b524d9aded373e7a27580ea0be55/main.py#L375-L383
Pretty sure the issue at hand is that the math of the breathingEffect function just uses a lot of CPU cycles, and each LED thread that uses it starts its own instance, which quickly adds up. Not really worth fixing.
Frequently, two threads take 100% cpu time each, even at idle. Likely due to improper / inefficient threading configuration.