Hello,
I am experimenting with a SPI display with Adafruit_GFX and Adafruit_ST7735 libraries.
Everything works as expected but when I try to use function tft.drawBitmap(x, y, image, w, h); the only way I can make it work is if I define the array containing the image in HEX directly in the main sketch.
I've found online that people put all the graphic files into a different tab with *.c extension and, in order to do so, they firstly add "#include <avr/pgmspace.h>" as first line in the *.c file and then, one after another, all the images in HEX defined as:
const unsigned char imagename1 [] PROGMEM = { ...HEX NUMBERS... };
const unsigned char imagename2 [] PROGMEM = { ...HEX NUMBERS... };
Then, in the main sketch tab, before setup, they add:
extern uint8_t imagename1;
extern uint8_t imagename2;
...
I am going crazy because, if I do so, the display shows some crazy random dots, if I simply put the HEX file in the main sketch everything work as supposed to do...
Anyone who could give me a hint on what am I doing wrong?
Many many thanks!
Alessandro