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 think it would be useful to have PROGMEM ready createChar variant - creating custom characters is usually done only once, so wasting RAM for bitmap could be avoided by loading it directly from program memory. I wonder if something like this would be sufficient?
voidcreateCharProgMem(uint8_t location, constuint8_t charmap[]) {
location &= 0x7; // we only have 8 locations 0-7command(LCD_SETCGRAMADDR | (location << 3));
for (uint8_t i = 0; i < 8; i++) {
write(pgm_read_byte_near(charmap + i));
}
}
voidcreateChar(uint8_t location, const __FlashStringHelper *buf) {
location &= 0x7; // we only have 8 locations 0-7command(LCD_SETCGRAMADDR | (location << 3));
for (uint8_t i = 0; i < 8; i++) {
write(pgm_read_byte_near((constuint8_t *)buf + i));
}
}
The text was updated successfully, but these errors were encountered:
Hello!
I think it would be useful to have PROGMEM ready createChar variant - creating custom characters is usually done only once, so wasting RAM for bitmap could be avoided by loading it directly from program memory. I wonder if something like this would be sufficient?
The text was updated successfully, but these errors were encountered: