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?
void createCharProgMem(uint8_t location, const uint8_t charmap[]) {
location &= 0x7; // we only have 8 locations 0-7
command(LCD_SETCGRAMADDR | (location << 3));
for (uint8_t i = 0; i < 8; i++) {
write(pgm_read_byte_near(charmap + i));
}
}
void createChar(uint8_t location, const __FlashStringHelper *buf) {
location &= 0x7; // we only have 8 locations 0-7
command(LCD_SETCGRAMADDR | (location << 3));
for (uint8_t i = 0; i < 8; i++) {
write(pgm_read_byte_near((const uint8_t *)buf + i));
}
}
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?