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
Hello! I used your library with my Pico to my alarm project. I used the LCD to type in the PIN needed to arm and disarm the alarm. My code utilises a while loop to await input from the keypad and then print a typed number on the LCD. I noticed that with every character printed a lot of memory of my Pico is being consumed. Apart from printstr() function I also noticed that lcd.clear() consumes a lot of memory too. When it's executed in a loop it takes all the memory from my Pico and the microcontroller freezes. I got rid of lcd.clear() function in my loop, but eveytime I printed a character on the LCD it still took memory. What I did was adding GarbageCollector library and adding a line with gc.collect() at the end of every function in pico_i2c_lcd.py. This really helped! Now any function from your library barely takes any memory off my microcontroller. I think you should add those lines to your code.
`import utime
from lcd_api import LcdApi
from machine import I2C
import gc
Hello! I used your library with my Pico to my alarm project. I used the LCD to type in the PIN needed to arm and disarm the alarm. My code utilises a while loop to await input from the keypad and then print a typed number on the LCD. I noticed that with every character printed a lot of memory of my Pico is being consumed. Apart from printstr() function I also noticed that lcd.clear() consumes a lot of memory too. When it's executed in a loop it takes all the memory from my Pico and the microcontroller freezes. I got rid of lcd.clear() function in my loop, but eveytime I printed a character on the LCD it still took memory. What I did was adding GarbageCollector library and adding a line with gc.collect() at the end of every function in pico_i2c_lcd.py. This really helped! Now any function from your library barely takes any memory off my microcontroller. I think you should add those lines to your code.
`import utime
from lcd_api import LcdApi
from machine import I2C
import gc
MASK_RS = 0x01
MASK_RW = 0x02
MASK_E = 0x04
SHIFT_BACKLIGHT = 3
SHIFT_DATA = 4
class I2cLcd(LcdApi):
`
The text was updated successfully, but these errors were encountered: