Add PROGMEM reader

Issue #24 resolved
Christopher Würtz created an issue

Could you quickly add a createChar function which reads the charmap from the flash memory?


void LiquidCrystal::createChar_P(uint8_t location, const prog_uchar charmap[]) { location &= 0x7; lcd.command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i<8; i++) { lcd.write(pgm_read_byte_near(charmap++)); } }

Comments (3)

  1. Christopher Würtz reporter

    Thx. But usually we add the "_P" suffix while the main parameter of a function is prog_* type.

  2. Francisco Malpartida repo owner

    This way you don't have to worry about having a different methods for character and will always use the same method regardless of where the information is located (similar to lcd::print). That's one of the nice features of C++.

  3. Log in to comment