You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Canvas drawing not working - it needs hard reset #39
I am using the M5 Dial and testing Canvas drawing. Each time I change the position or color of a circle and save it to the M5 Dial (whether using UIFlow, VS Code, or Thonny), I need to restart the device with a hard reset for the changes to be visible, otherwise the Lcd stops drawing anything and just shows the black background. The changes don't take effect after a soft reset or when pasting the same code through REPL, which is something that is expected I guess.
The Widgets.Image works fine (it doesn't require a hard reset and behaves as expected), but I specifically want to use the Canvas for smooth drawing of graphics/images. The issue I encounter with Widgets.Image is that when I try to animate the image's movement, the screen flickers.
This is what I got in main.py, just changing the canvas.drawCircle parameters, would result in completely black screen.
@lbuque Thanks for the answer! However, isn't it strange that a 240x240 canvas works every time I perform a hard reset, but not with a soft reset? Could there be a potential memory leak?
What is the maximum possible canvas size (or the maximum available memory)?
What is the recommended way to animate images without flickering?
I understand. Would it be possible to release it through code, perhaps using something like gc.collect() or a similar method? If you could also address two other questions I have, I would greatly appreciate it. Thank you so much!
Activity
lbuque commentedon Nov 19, 2024
@mroglic Dial does not have enough memory to create a 240*240px canvas.
mroglic commentedon Nov 20, 2024
@lbuque Thanks for the answer! However, isn't it strange that a 240x240 canvas works every time I perform a hard reset, but not with a soft reset? Could there be a potential memory leak?
What is the maximum possible canvas size (or the maximum available memory)?
What is the recommended way to animate images without flickering?
Thanks!
lbuque commentedon Nov 21, 2024
During a soft reset, the canvas memory is not released.
mroglic commentedon Nov 21, 2024
I understand. Would it be possible to release it through code, perhaps using something like gc.collect() or a similar method? If you could also address two other questions I have, I would greatly appreciate it. Thank you so much!
mroglic commentedon Nov 29, 2024
@lbuque can you please advise on how to achieve this?