-
Notifications
You must be signed in to change notification settings - Fork 9
Progress Bar slows down progressively #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The youtube link is having a problem, it points to a github page instead of youtube. Copy pasting the youtube URL worked though. I think I see what you mean about it slowing down toward the end. The fact that the decimals in your print outs change from Another thing I've noticed is that printing takes a relatively long time compared to many other operations. You might try removing (or commenting) the print statement and see if it has an impact on the performance. I can test this out later tonight on some other devices to see if I can replicate the issue and try to understand what could be causing it. Edit: I took a quick peek at the code. At first glance I think this for loop might be responsible for the slowed performance:
If I am understanding that section of the code correctly I think it means that it is filling in the entire progress bar each time you update, even the section to the left of the new value that was already filled in gets filled in again. Since larger progresses require more pixels to be filled during this progress it takes longer. |
Quick update, tried it without the print with the same outcome. |
I think @FoamyGuy is right on the money. The code could only modify the new pixels. If it had refresh control it could also pause refreshes. It could also not use a bitmap and save memory. |
Happy to. I haven't built mpy's before so I'll look into how to do that this weekend. Thanks! |
I tested it and it no longer has the slowdown, thanks! I'm a bit confused by 100% now being 21, could you explain? This print output is a bit wonky as well, I added a *100 which fixed it. |
This is resolved my merged PR #8 |
With the example slightly modified to work with the Adafruit FeatherWing OLED screen, I see the progress bar progression across the screen slow down as the percentage increases. Any pointers on how to troubleshoot this?
Here is a video: https://youtu.be/B2AHjPbJh7c
And the code:
The text was updated successfully, but these errors were encountered: