A few more tips
- Use list generators when possible rather than creating lists (for example use
range()
to create a sequential list of values on the fly without assigning it to a variable). - “pystack exhausted” errors - you may be doing something with a lot of of levels of function calls or recursion. Maybe try another way of solving your problem. Other times the cause is unclear, ask for guidance on the
help-with-CircuitPython
channel on discord: https://adafru.it/discord
Other resources for optimizing memory in CircuitPython
Page last edited March 08, 2024
Text editor powered by tinymce.