I need some help understanding why this doesn't work. The code successfully compiles however the bitmap is not correctly drawn, it renders as a static mess of dots.
char *someBitmaps[] = {
"Picture One",
"Picture Two",
"Picture Three",
};
int pictureNumber = 0;
const uint8_t PictureOne [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, .... };
const uint8_t PictureTwo [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, .... };
const uint8_t PictureThree [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, .... };
void drawPicture() {
String drawImage = someBitmaps[pictureNumber];
drawImage.replace(" ", "");
u8g2.firstPage();
do {
u8g2.drawXBMP( 0, 0, 128, 32, drawImage.c_str() );
} while( u8g2.nextPage() );
}
I'm expecting PictureOne to render.
Naturally if I type:
u8g2.drawXBMP( 0, 0, 128, 32, PictureOne );
The bitmap renders correctly.
If I print the value to the OLED screen using this command:
u8g2.print( drawImage.c_str() );
The correct value (PictureOne) is printed to the screen.
Am I doing something wrong or is this simply not possible?