Problems showing images

Ok. The idea is that I have a LCD display and it will show a image each time you push a button. 17 times will happen this and finally it will stay with the last image until you push a second button that will reset everything.

But. I can’t write a good code :frowning:

For now I am trying to repeate the cycle 3 times, but it is not working so I am not adding the second button yet.

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

const unsigned char PROGMEM logo1[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x07, 0xFF, 0xFF, 0xFE, 0x00, 0x0F, 0xFF, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xC0, 0x0F, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xE0, 0x1F, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x3F, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x01, 0xFE, 0x00, 0x00, 0x07, 0xF8, 0x3F, 0x1F, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x7F, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x7E, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0xFC, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x07, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x07, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x07, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x07, 0xE0, 0x20,
0x01, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x20,
0x01, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x1F, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x20,
0x01, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x1F, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0x07, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x1F, 0x00, 0x7F, 0xFF, 0xFF, 0xFE, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

//This will be repeated 17 times



const unsigned char * const logo[] PROGMEM  = {logo1, logo2, logo3};


const int buttonPin = 2;
int counter = 0;   
int buttonState = 0;         
int lastButtonState = 0;     


void setup()   {                
  Serial.begin(9600);
 display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.display();
  delay(2000);


  display.clearDisplay();


 pinMode(buttonPin,INPUT); 

  
}


void loop() {

  buttonState = digitalRead(buttonPin);
    if (buttonState != lastButtonState) {
 
    if (buttonState == HIGH) {
      
      counter++;
      
      if (counter <= 3) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo[counter], 128,64,WHITE);
        display.display();
        delay(200);
      }
      if (counter >= 4) { 
        // draw a single pixel
          display.drawPixel(10, 10, WHITE);
            display.display();
           delay(2000);
       
        } 
      } 
      }   
 lastButtonState = buttonState;

}

I would check with this guy o ese tipo, ellos parecen tener el mismo problema.

:wink:

Well, thefirst one is in english and was written because a specific error, not because me having problems writing the code. The subject of the topic was about my issues with the arrays, a problem that is solved now, and I thought that it was better to start a new thread with a less specific question.

The second one is in spanish, so I thought about looking for help in english as there are more people here.

I don't think that I am doing bad A) starting a new thread and B) looking for the same answers in spanish and english, but anyways, ok. I will wait at the spanish forum.

Thanks

const unsigned char * const logo[] PROGMEM  = {logo1, logo2, logo3};

Is it REALLY necessary to save 17 (eventually) bytes, by keeping these pointers out of SRAM?

        display.drawBitmap(0,-15, logo[counter], 128,64,WHITE);

The third argument is supposed to be a pointer to data in FLASH, not a pointer in FLASH to a pointer in FLASH.

Instead of making your life three times as difficult as it needs to be, let logo be copied to SRAM at run time. The pointers in the array will then point to data in FLASH, which is what drawBitmap() expects.

Each image is like this

static const unsigned char PROGMEM logo12[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0x00, 0x07, 0xFF, 0x83, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x20,
0x01, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xC0, 0x07, 0xFF, 0x83, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x20,
0x01, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xE0, 0x0F, 0xFF, 0x83, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x0F, 0xFF, 0x83, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x1F, 0xFF, 0x83, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x01, 0xFC, 0x00, 0x00, 0x03, 0xF8, 0x1F, 0x8F, 0x80, 0x00, 0x00, 0x00, 0x1F, 0x80, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x3F, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x1F, 0x80, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x3F, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x1F, 0x80, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x7E, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x1F, 0x80, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x1F, 0x80, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x0F, 0x80, 0x7F, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x0F, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x0F, 0x83, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x0F, 0x83, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x0F, 0x87, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x0F, 0x87, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x0F, 0x87, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x0F, 0x87, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x0F, 0x87, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x0F, 0x87, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x0F, 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x0F, 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x20,
0x01, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x0F, 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x20,
0x01, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x0F, 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x20,
0x01, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x0F, 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x20,
0x01, 0x00, 0x01, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x0F, 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

I tried to define it without the PROGMEM, but there is not enough memory even for 3 images.

So I have to do it this way.

You say that the drawBitmap() expects data in FLASH, how can I change that?

So I have to do it this way.

I KNOW the bitmaps have to be in PROGMEM, and that you are, effectively, defining a pointer to data in PROGMEM.

You do NOT have to store the pointer in PROGMEM, though, which is what you are doing when you define the array of pointers as being in PROGMEM.

To access the pointed to data, when the pointer is in PROGMEM, you must first fetch the pointer from PROGMEM and then fetch the pointed to data from PROGMEM.

The drawBitmap() function already does the second part. YOU must do the first part, or you must stop storing the pointers in PROGMEM. Your choice.

Thanks. That was the problem :slight_smile: