0

Character LCD
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Character LCD

by mossyoak1101 on Sun Feb 21, 2021 1:33 am

Hello,
I am trying to create a character using create_char. It may be the lack of sleep, but I am completely stumped on how to use this function. I have been to the suggested page to generate my character but I am still not grasping how to use the provide information to create the character.


In decimal: 12,18,18,12,0,0,0
In hex: 0xc,0x12,0x12,0xc,0x0,0x0,0x0
In binary: %1100,%10010,%10010,%1100,%0,%0,%0

Any help on how I can create the character from this would be fantastic.
Thank you!

mossyoak1101
 
Posts: 15
Joined: Fri Nov 30, 2018 5:43 pm

Re: Character LCD

by dastels on Sun Feb 21, 2021 10:20 am

From https://circuitpython.readthedocs.io/projects/charlcd/en/latest/api.html:
create_char(location, pattern)

Fill one of the first 8 CGRAM locations with custom characters. The location parameter should be between 0 and 7 and pattern should provide an array of 8 bytes containing the pattern. E.g. you can easily design your custom character at http://www.quinapalus.com/hd44780udg.html To show your custom character use, for example, lcd.message = ""
Parameters:

location – integer in range(8) to store the created character
pattern (~bytes) – len(8) describes created character


So location is the number of the custom character to create, and pattern is the bit pattern for the character, which is an array of 8 bytes. Each byte is a row of the bit pattern.

Dave

dastels
 
Posts: 5392
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.