drawing a bitmap keeps producing errors

I want to show a simple logo on my TFT screen but cant get it working. Its most lickly a simple error but.....
so at the top of the sketch I have

#include <SPI.h>
#include <TFT.h>


extern uint8_t kunstmaan[];

and after initializing the TFT I want to draw the logo called kunstmaan

  delay(100);
  TFTscreen.drawBitmap(65, 70, kunstmaan, 73, 64, GREEN);
  delay(2000);

The array thayt contains the logo looks like this

#pragma once
#define CUSTOM_BOOTSCREEN_BMPWIDTH  78
#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
const unsigned char custom_kunstmaan[] PROGMEM = {
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111110,B01111111,B11111111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000,B00111111,B11111111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11100000,B00001111,B11111111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11000000,B00001111,B11111111,
  B11111111,B11111111,B11111111,B00001100,B11111111,B11111111,B01000000,B00010011,B11111111,
  B11111111,B11111111,B11111110,B01100000,B01111111,B11111100,B00100000,B01000000,B11111111,
  B11111111,B11111111,B11111100,B10000000,B00011111,B11110000,B00010001,B10000000,B01111111,
  B11111111,B11111111,B11111101,B00000000,B00001111,B11000000,B00000110,B00000000,B00111111,
  B11111111,B11111111,B11111101,B00000000,B00000111,B10000000,B00001010,B00000000,B01111111,
  B11111111,B11111111,B11111100,B00000000,B00000011,B11000000,B00100001,B00000001,B11111111,
  B11111111,B11111111,B11111110,B00000000,B00000001,B10000000,B11000000,B10000111,B11111111,
  B11111111,B11111111,B11111100,B00000000,B00000000,B01110011,B00000000,B01111111,B11111111,
  B11111111,B11111111,B11111100,B00000000,B00111110,B11111100,B00000000,B00111111,B11111111,
  B11111111,B11111111,B11111100,B00000000,B01000000,B11111110,B00000000,B11111111,B11111111,
  B11111111,B11111111,B11111100,B00000000,B00000000,B01111111,B00000001,B11111111,B11111111,
  B11111111,B11111111,B11111110,B00000001,B00000000,B01111111,B10000111,B11111111,B11111111,
  B11111111,B11111111,B11111111,B00000010,B00000000,B00001111,B00011111,B11111111,B11111111,
  B11111111,B11111111,B11111111,B10000010,B00000000,B00000000,B11111111,B11111111,B11111111,
  B11111111,B11111111,B11111111,B11000000,B00010000,B00000001,B11111111,B11111111,B11111111,
  B11111111,B11111111,B11110011,B10000100,B00100000,B00000001,B11111111,B11111111,B11111111,
  B11111111,B11111111,B11000000,B00100100,B00000000,B00000000,B11111111,B11111111,B11111111,
  B11111111,B11111111,B00000000,B11110000,B00000000,B00000000,B01111111,B11111111,B11111111,
  B11111111,B11111100,B00000000,B01111000,B00000000,B00000000,B00111111,B11111111,B11111111,
  B11111111,B11110000,B00000000,B01111111,B00000000,B00000000,B00011111,B11111111,B11111111,
  B11111111,B11010000,B00000001,B10111111,B00000000,B00000000,B00001111,B11111111,B11111111,
  B11111111,B00001000,B00000110,B00011111,B00000000,B00000000,B00000111,B11111111,B11111111,
  B11111100,B00000100,B00001000,B00001110,B00000000,B00000000,B01111011,B11111111,B11111111,
  B11110000,B00000100,B00100000,B00000001,B10000000,B00000001,B10001111,B11111111,B11111111,
  B11000000,B00000010,B10000000,B00000111,B11000000,B00000010,B00000011,B11111111,B11111111,
  B10000000,B00000011,B00000000,B00000111,B11100000,B00000100,B00111111,B11111111,B11111111,
  B10000000,B00001101,B00000000,B00011111,B11110000,B00001000,B11000111,B11000000,B00111111,
  B11000000,B00110000,B10000000,B01111111,B11111000,B00010001,B00000110,B00000000,B11011111,
  B11000000,B11000000,B01000000,B11111111,B11111000,B00000010,B00000100,B00000111,B11101111,
  B11100001,B00000000,B00100011,B11111111,B11111100,B00100010,B00000000,B00000111,B11101111,
  B11100100,B00000000,B00101111,B11111111,B11111110,B00100100,B00000000,B01110011,B11101111,
  B11111000,B00000000,B00111111,B11111111,B11111111,B00100100,B00000000,B11111011,B11111111,
  B11111000,B00000000,B01111111,B11111111,B11111111,B10110100,B00000001,B11111011,B11011111,
  B11111000,B00000001,B11111111,B11111111,B11111111,B11001111,B00000001,B11111011,B11011111,
  B11111100,B00000111,B11111111,B11111111,B11111111,B11111110,B00000101,B11111011,B10111111,
  B11111100,B00001111,B11111111,B11111111,B11111111,B11111110,B00011011,B11111011,B00111111,
  B11111110,B00111111,B11111111,B11111111,B11111111,B11111100,B00011111,B11111011,B01111111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111000,B00111111,B11111010,B11111111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111000,B01111111,B11111001,B11111111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111000,B01111111,B11111011,B11111111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11110000,B00001111,B11100011,B11111111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11110001,B11110000,B01100011,B11111111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11110001,B11111111,B00000011,B11111111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11110001,B11111111,B00111001,B11111111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11110011,B11111110,B11111001,B11110111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111011,B11111001,B11111111,B11110111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111001,B11000111,B11111111,B11100111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B01111111,B11111111,B11101111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11001110,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B00011110,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000,B01111100,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111001,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110011,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11000111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000,B00011111,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111101,B11111110,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111100,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110001,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000011,
  B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000,B00011111 
};

suggestion on whats wrong here, thanks

Harry

custom_kunstmaan Am I missing something?

gharryh:

extern uint8_t kunstmaan[];

and after initializing the TFT I want to draw the logo called kunstmaan

  delay(100);

TFTscreen.drawBitmap(65, 70, kunstmaan, 73, 64, GREEN);
 delay(2000);



The array that contains the logo looks like this


#pragma once
#define CUSTOM_BOOTSCREEN_BMPWIDTH  78
#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
const unsigned char custom_kunstmaan[] PROGMEM = {};



suggestion on whats wrong here, thanks
  • As AWOL said, your array name doesn't match: "kunstmaan" is not "custom_kunstmaan".
  • Your bitmap is apparently 78x64 and it appears you are trying to display it as 73x64.
  • You are putting the bitmap in PROGMEM and it is not clear that the 'drawBitmap()' function expects the data to be in PROGMEM.
  • What is the extension of the file containing the bitmap? If it is .cpp then it should work. If it is .c then you have to let the C++ compiler know that the external variable is in a .c file.

You should look more closely at the example you were following.

johnwasser:

  • What is the extension of the file containing the bitmap? If it is .cpp then it should work. If it is .c then you have to let the C++ compiler know that the external variable is in a .c file.

You should look more closely at the example you were following.

The bitmap is not on file but is in the flash memory

gharryh:
The bitmap is not on file but is in the flash memory

Once you've successfully uploaded the sketch it should be, yes.. until that time it is on your hard-drive in a file.