I am working with an ESP32 card with a lot of components, in particular an ssd1306 screen, I found a library where I can put letters on the screen, in short I have a problem when I call the library in a test the problem is this one :
Traceback (most recent call last):
File "main.py", line 25, in <module>
File "hello_world.py", line 1, in <module>
MemoryError: memory allocation failed, allocating 136 bytes
I put here the library : https://github.com/nickpmulder/ssd1306big/blob/main/ssd1306big.py
And my hello world:
import ssd1306big
import time
write = ssd1306big
while True:
write.clear()
write.wrap("Hello")
time.sleep(5)
if you have a lot of components and libraries and wish to minimize memory usage you have two options: freeze libs into firmware (best memory optimisation option) or use mpy-cross to "compile" you libraries into bytecode that lower memory utilisation. https://github.com/robert-hh/Shared-Stuff