简体   繁体   中英

Arduino grove serial lcd custom characters

I have grove serial lcd screen 16x2. Link.

I want to print some custom characters, but official library doesn't contain functions for creation custom chars. I've tried to use some other libraries for LCD screens which uses i2c protocol, they provide needed functions, but they don't work with this screen.

Maybe anyone had this problem?

The problem is not having a function on the Arduino to make a custom char, it is that the PIC (with its current program) does not have a protocol for creating custom chars. As a result it would be impossible to make custom chars without re-programming the PIC.

As an alternative you might consider removing the board with the PIC on it to expose the display's original header. Then, as the display uses a Hitachi HD44780 (or compatible) controller, you should be able to set it up using the built-in LiquidCrystal Arduino library.


If you use the built-in Hitachi compatible library making custom chars is quite simple:

1: Create a byte to store your char:

byte myChar[8] = {
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000
};

2: In your init phase initialize the char:

lcd.createChar(0, myChar); // lcd.createChar(int, byte)

3: Finally you can print/write the char using its identifier (the int you passed in lcd.createChar):

lcd.write(byte(0));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM