Reading a bitmap from SD card and showing it on OLED

Hello everybody,

My project is to read a bitmap from an SD card and show it on an OLED.

First I changed the bitmap to hexadecimal unsigned char variable as shown in the OLED example for drawing a bit map.
I put the unsigned char variable instead of the SeeedLogo variable that was given in the example and it works.

Second i put this variable in an text file and the text file was put in its turn in an SD card. The text file is read by the serial port and everything is okay.

The problem is when I read the text file from SD card it is not shown correctly in the OLED.
The second problem is that this code uses a huge percent of the dynamic memory because of the unsigned char is not in defined as static const unsigned char.

The code and the result has been attached to this question.

Can somebody help me?

sketch_jan21d.ino (1.44 KB)

please post the code directly into the forum using code tags. here it is for the others.

/*
  The circuit:
   SD card attached to SPI bus as follows:
 ** MOSI - pin 11
 ** MISO - pin 12
 ** CLK - pin 13
 ** CS - pin 4
*/

#include <Wire.h>
#include <SeeedGrayOLED.h>
#include <avr/pgmspace.h>
#include <stdlib.h>

#include <SPI.h>
#include <SD.h>

File myFile;
File bMap;
unsigned  char bitmp[512];
int index = 0;

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  Serial.print("Initializing SD card...");
  if (!SD.begin(8)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");
  // open the file for reading:
  myFile = SD.open("t2.txt");
  //bMap = SD.open("t.bmp", FILE_READ);
  if (myFile) {
    while (myFile.available()) {
      bitmp [index] = (unsigned char) myFile.read();
      index++;
    }
    for (int i = 0; i < 512; i++) {
      Serial.write(bitmp[i]);
    }
    myFile.close();
    Wire.begin();
    SeeedGrayOled.init();              // initialize SEEED OLED display
    SeeedGrayOled.clearDisplay();                  //  clear the screen and set start position to top left corner
    SeeedGrayOled.drawBitmap(bitmp, 96 * 96 / 8); //  Draw binary Bitmap (96 pixels *96 pixels  / 8) bytes
  }
  else {
    // if the file didn't open, print an error:
    Serial.println("error opening test.txt");
  }
}

void loop() {
  // nothing happens after setup
}

why don't you print index to see how many bytes were read from the SD into your bitmp array?

what does your for loop

    for (int i = 0; i < 512; i++) {
      Serial.write(bitmp[i]);
    }

prints out? is that what you expect from the SD card?

also what's your OLED? is that a 96x96? are you sure you have the right lib? and the right call for SeeedGrayOled.drawBitmap(bitmp, 96 * 96 / 8 ); / (your code seems to indicate you've read in 512 bytes for your bitmap so how does this relate to 96 x 96 / 8

My project is to read a bitmap from an SD card and show it on an OLED.

We know - you told us that in your other, virtually identical thread (now deleted).

DO NOT CROSS-POST, CROSS-POSTING WASTES TIME.

Thank you for your quick reply
First the file is read completely. I have printed the index and here it is
<1234567891011121...10901>
I have tried to print the file and it works, I mean it was read completely.
The loop is to check that if myFile has been written correctly in bitmp.
The library for the OLED is correct, I have tried it by defining the bitmp manually and it works.

/*
 The circuit:
* SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4
*/

#include <Wire.h>
#include <SeeedGrayOLED.h>
#include <avr/pgmspace.h>
#include <stdlib.h>

#include <SPI.h>
#include <SD.h>

File myFile;
File bMap;
unsigned  char bitmp[512];
int index=0;

void setup() {
 // Open serial communications and wait for port to open:
 Serial.begin(9600);
 while (!Serial) {
   ; // wait for serial port to connect. Needed for native USB port only
 }
 Serial.print("Initializing SD card...");
 if (!SD.begin(8)) {
   Serial.println("initialization failed!");
   return;
 }
 Serial.println("initialization done.");
 // open the file for reading:
 myFile = SD.open("t2.txt");
 //bMap = SD.open("t.bmp", FILE_READ);
 if (myFile) {
    while (myFile.available()) {
      //bitmp [index] = (unsigned char) myFile.read();
      //index++;
      //Serial.print(index);
      Serial.write(myFile.read());
      }
   /* for(int i=0; i<512; i++){
      Serial.write(bitmp[i]);
    }*/
 myFile.close();
 Wire.begin(); 
 SeeedGrayOled.init();              // initialize SEEED OLED display
 SeeedGrayOled.clearDisplay();                  //  clear the screen and set start position to top left corner
 SeeedGrayOled.drawBitmap(bitmp,96*96/8);   //  Draw binary Bitmap (96 pixels *96 pixels  / 8) bytes
 }
else {
   // if the file didn't open, print an error:
   Serial.println("error opening test.txt");
 }
}

void loop() {
 // nothing happens after setup
}

>

AWOL:
We know - you told us that in your other, virtually identical thread (now deleted).

DO NOT CROSS-POST, CROSS-POSTING WASTES TIME.

I am sorry. I was trying to upload my image, the question was sent two times

but your bitmap is of 512 bytes, this is not a 96 x 96 pixel bitmap... what's the size ?

the doc states:

** **drawBitmap(unsigned char *bitmaparray,int bytes)** **
Display a binary bitmap on the OLED matrix. The data is provided through a pointer to unidimensional array holding bitmap. The bitmap data is available in continuous rows of columns as like Horizontal Addressing mode.
bytes is size of bitmap in bytes.

J-M-L:
but your bitmap is of 512 bytes, this is not a 96 x 96 pixel bitmap... what's the size ?

the doc states:

That is true. But I am trying to show the first pixels of the image.
Of course, I don't know what to do in the next step, I mean if i show these pixels, that is can't do it till now, there is no enough memory for the others

steve123456789:
That is true. But I am trying to show the first pixels of the image.
Of course, I don't know what to do in the next step, I mean if i show these pixels, that is can't do it till now, there is no enough memory for the others

I put the read data from the SD card and it works

Any help?

Any details?
Any observations?

The output of the read file is shown in the attached image:

The image is shown correctly when i copy this output (variable) and paste it in the bitmap example instead of SeeedLogo

#include <Wire.h>
#include <SeeedGrayOLED.h>
#include <avr/pgmspace.h>

static const unsigned char SeeedLogo[] PROGMEM = 
{

0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x06, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xC0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0xC0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x80, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x03, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x01, 0xC0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x07, 0x80, 0x01, 0xE0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0F, 0x80, 0x01, 0xE0,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0F, 0x00, 0x01, 0xE0, 0x08, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x30, 0x0F, 0x00, 0x01, 0xE0, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x0F, 0x00, 0x01, 0xE0, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0F, 0x00, 0x01, 0xE0,
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x0F, 0x00, 0x01, 0xE0, 0x18, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x38, 0x0F, 0x00, 0x01, 0xE0, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
0x0F, 0x80, 0x01, 0xE0, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x0F, 0x80, 0x01, 0xE0,
0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x0F, 0x80, 0x03, 0xE0, 0x78, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1E, 0x07, 0x80, 0x03, 0xE0, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E,
0x07, 0x80, 0x03, 0xE0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x07, 0x80, 0x03, 0xC1,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x87, 0xC0, 0x07, 0xC1, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0x83, 0xC0, 0x07, 0x83, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xC3, 0xC0, 0x07, 0x87, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE1, 0xE0, 0x07, 0x0F,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xF0, 0xE0, 0x0F, 0x0F, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0xF8, 0xF0, 0x0E, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0xF8, 0x70, 0x1C, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x30, 0x18, 0x7E,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x18, 0x30, 0xFC, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1F, 0x88, 0x21, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0F, 0xC4, 0x47, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xE0, 0x0F, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x06,
0x00, 0x00, 0x60, 0x00, 0x7E, 0x3F, 0x0F, 0xC3, 0xF0, 0xFA, 0x0F, 0xDF, 0xE1, 0x9F, 0xEC, 0x7E,
0xE6, 0x73, 0x9C, 0xE7, 0x39, 0xCE, 0x1C, 0xDF, 0xE1, 0xB9, 0xEC, 0xE7, 0xE0, 0x61, 0xD8, 0x66,
0x1B, 0x86, 0x1C, 0x06, 0x61, 0xB0, 0x6D, 0xC3, 0x7C, 0x7F, 0xFF, 0xFF, 0xFF, 0x06, 0x0F, 0x86,
0x61, 0xB0, 0x6D, 0x83, 0x3E, 0x7F, 0xFF, 0xFF, 0xFF, 0x06, 0x07, 0xC6, 0x61, 0xB0, 0x6D, 0x83,
0xC3, 0x61, 0x18, 0x46, 0x03, 0x86, 0x18, 0x66, 0x61, 0xB0, 0x6D, 0xC3, 0xFE, 0x7F, 0x9F, 0xE7,
0xF9, 0xFE, 0x1F, 0xE6, 0x3F, 0x9F, 0xEC, 0xFE, 0x7E, 0x3F, 0x0F, 0xC3, 0xF0, 0xFA, 0x0F, 0xC6,
0x3F, 0x9F, 0xEC, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00,
0x00, 0x20, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x20, 0x82, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0xF3, 0xCF, 0x70, 0x9E, 0x79, 0xE7, 0x80, 0x00, 0x00,
0x00, 0x00, 0x7D, 0x9E, 0x68, 0x20, 0xB2, 0xC8, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x9E,
0x6F, 0x20, 0xB2, 0xF9, 0xE7, 0x80, 0x00, 0x00, 0x00, 0x00, 0x46, 0x9A, 0x61, 0x20, 0xB2, 0xCB,
0x60, 0x80, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xF3, 0xCF, 0x30, 0x9E, 0x79, 0xE7, 0x90, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x02, 0x00, 0x00, 0x82, 0x60, 0x00, 0x00,
0xF8, 0x00, 0x00, 0x40, 0x40, 0x02, 0x00, 0x00, 0x83, 0x60, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x40,
0x60, 0xB7, 0x79, 0xE7, 0x81, 0xC7, 0x92, 0x70, 0x89, 0xE7, 0x9E, 0x78, 0x7C, 0xE2, 0xC9, 0x2C,
0x81, 0xCC, 0xD2, 0x40, 0xFB, 0x21, 0xB2, 0x48, 0x40, 0x62, 0xF9, 0x2C, 0x80, 0x8C, 0xD2, 0x40,
0x8B, 0xE7, 0xB0, 0x48, 0x40, 0xE2, 0xC9, 0x2C, 0x80, 0x84, 0xD2, 0x40, 0x8B, 0x2D, 0x92, 0x48,
0x7D, 0xB3, 0x79, 0x27, 0x80, 0x87, 0x9E, 0x40, 0x8D, 0xE7, 0x9E, 0x48, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

void setup()
{
  Wire.begin();	
  SeeedGrayOled.init();  		         // initialize SEEED OLED display
  SeeedGrayOled.setInverseDisplay();             // Set Display to inverse mode  
  SeeedGrayOled.clearDisplay();                  //  clear the screen and set start position to top left corner
  SeeedGrayOled.drawBitmap(SeeedLogo,96*96/8);   // (96 pixels *96 pixels  / 8) bytes
}

void loop()
{
  
}

I mean it is read correctly and when I put it manually instead of Seedlogo it works

Serial.print("Initializing SD card...");etc.

You seem to have a very lax attitude to RAM usage; are you running short?

AWOL:
Serial.print("Initializing SD card...");etc.

You seem to have a very lax attitude to RAM usage; are you running short?

I am having a problem that the 71 percent of the RAM is used

steve123456789:
The output of the read file is shown in the attached image:

The image is shown correctly when i copy this output (variable) and paste it in the bitmap example instead of SeeedLogo

#include <Wire.h>

#include <SeeedGrayOLED.h>
#include <avr/pgmspace.h>

static const unsigned char SeeedLogo[] PROGMEM =
{ // here you have 1152 bytes
};





I mean it is read correctly and when I put it manually instead of Seedlogo it works

unless I'm mistaken this SeeedLogo array is composed of 72 lines x 16 bytes = 1152 bytes.

a 96x96 LCD = 9216 pixels. each pixel is represented with 1 bit, arranged as part of bytes. so a byte, 8 bit, represents 8 pixels and thus to represent you 9216 pixels, you need 9216 / 8 = 1152 bytes which is (surprise!) what you have in the SeeedLogo array.

==> the SeeedLogoarray fills up the whole screen.

In the code you propose above you are allocating unsigned  char bitmp[[color=red]512[/color]]; only 512 bytes.

What do you really have in your SD card? those 1152 bytes or only 512?

--> you are clearly not doing the same thing.

J-M-L:
unless I'm mistaken this SeeedLogo array is composed of 72 lines x 16 bytes = 1152 bytes.

a 96x96 LCD = 9216 pixels. each pixel is represented with 1 bit, arranged as part of bytes. so a byte, 8 bit, represents 8 pixels and thus to represent you 9216 pixels, you need 9216 / 8 = 1152 bytes which is (surprise!) what you have in the SeeedLogo array.

==> the SeeedLogoarray fills up the whole screen.

In the code you propose above you are allocating unsigned  char bitmp[[color=red]512[/color]]; only 512 bytes.

What do you really have in your SD card? those 1152 bytes or only 512?

--> you are clearly not doing the same thing.

Thanks again,
Here I have two problems:

The first is that the 512 bytes are not shown at the screen, I mean the first 512 bytes should be shown at least without any problem. I didn't use 1152 bytes because the RAM is filled.

The second problem is that if I show the first 512 bytes and the everything was okay, how could I show the other pixels. Maybe I will use another Arduino.

I think it is better to solve the first problem, I mean working step by step is better.

when you call SeeedGrayOled.drawBitmap(bitmp, 96 * 96 / 8 ); depending on where bitmp was allocated in memory, you are telling the function to read 1152 which might actually be beyond the end of the memory of your arduino and thus create issues.

do you need a logo that takes the full screen?

I've not checked the library or the way this OLED works, but you might have options to upload only smaller pieces and paint your logo with smaller blocks that you would read one by one form the SDCard instead of a full thing.

J-M-L:
when you call SeeedGrayOled.drawBitmap(bitmp, 96 * 96 / 8 ); depending on where bitmp was allocated in memory, you are telling the function to read 1152 which might actually be beyond the end of the memory of your arduino and thus create issues.

do you need a logo that takes the full screen?

I've not checked the library or the way this OLED works, but you might have options to upload only smaller pieces and paint your logo with smaller blocks that you would read one by one form the SDCard instead of a full thing.

It is not problem for me that the logo takes the full screen or not.
I need to see anything on the screen, the first bytes are enough for me at least till now

It is not problem for me that the logo takes the full screen or not.

your arduino does not care if you don't see that as a problem or not, it's definitely a problem for your arduino :slight_smile:

--> it is a problem in your code if the bitmap you give to the function does not have the bits you are telling the function to use...

J-M-L:
your arduino does not care if you don't see that as a problem or not, it's definitely a problem for your arduino :slight_smile:

--> it is a problem in your code if the bitmap you give to the function does not have the bits you are telling the function to use...

Thanks,
Any suggestions?

It looks like you are trying to open a .bmp type file. I don't see where you are taking care of reading the bitmap header info. to see what format its stored in. And, I don't see where you are taking care of the byte swapping issues either.

Or is it some other type file and its just using the .bmp extension?

-jim lee