Hi all,
I know this is simple, but I'm just not seeing it.
Using the LiquidCrystal library, custom characters can be generated and loaded into the display like this:
uint8_t custom0[] = { // a cute little star
0b00000, //
0b10101, // # # #
0b01110, // # # #
0b11111, // # # # # #
0b01110, // # # #
0b10101, // # # #
0b00000, //
0b00000, //
};
LCD.createChar (0, custom0); // put the bitmap in LCD slot 0
Then, by doing [b]LCD.write (0);[/b] the custom character is printed.
Now, what I want to be able to do is define multiple characters with one variable name. Instead of "custom0", "custom1", "custom2", etc... what I want is something like this:
uint8_t *custom[] = {
{ first block of 8 bytes },
{ second block of 8 bytes },
// etc....
{ eighth (and last) block of 8 bytes },
};
so that I can do this:
for (x = 0; x < 8; x++) {
LCD.createChar (x, custom[x]); // define them all at once
}
and this:
for (x = 0; x < 8; x++) {
LCD.write (custom[x]); // print all of them
}
For the life of me, I can't seem to figure out the proper syntax for the array definition.
Any help will be greatly appreciated. Thanks!