CircuitPython on the CPX with a character lcd

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mkingdom
 
Posts: 5
Joined: Fri Oct 28, 2016 1:14 pm

CircuitPython on the CPX with a character lcd

Post by mkingdom »

Hi. Trying to set up an I2C RGB 16x2 LCD https://www.waveshare.com/wiki/LCD1602_RGB_Module with my CPX using adafruit_character_lcd.character_lcd

Using CircuitPyhon 7.0.0 and 7.0.0 Libraries (see screenshot) and getting error as below.

Any thoughts please?

-----------------------------------------]

Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit CircuitPlayground Express with samd21g18
>>> import time
>>> import board
>>> import adafruit_character_lcd.character_lcd_i2c as character_lcd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_character_lcd/character_lcd_i2c.py", line 32, in <module>
File "adafruit_character_lcd/character_lcd.py", line 100, in <module>
File "adafruit_character_lcd/character_lcd.py", line 312, in Character_LCD
MemoryError: memory allocation failed, allocating 136 byte
>>>
Screenshot 2021-10-15 at 15.26.51.png
Screenshot 2021-10-15 at 15.26.51.png (179.05 KiB) Viewed 83 times

User avatar
danhalbert
 
Posts: 4653
Joined: Tue Aug 08, 2017 12:37 pm

Re: CircuitPython on the CPX with a character lcd

Post by danhalbert »

The CPX has a limited amount of RAM. Unfortunately, some libraries simply don't fit as is. (The amount of free space in CIRCUITPY does not affect that.) You could try pruning down the character LCD library to include only what you need.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”