I give you the example that I was trying to do, you will see that it is very simple.
I must upload it as a code that, being new, does not let me upload files. Thanks for the help.
Robot-slave.ino
#include "Robot-emotion-images.h"
#include <Arduino_GFX_Library.h>
Arduino_DataBus *bus = new Arduino_HWSPI(16 /* DC */, 5 /* CS */);
Arduino_GFX *gfx = new Arduino_ILI9341(bus, 17 /* RST */);
void setup() {
Serial.begin(9600);
}
void loop() {
int16_t wid = gfx->width();
int16_t ht = gfx->height();
for (int instanceIndex = 0; instanceIndex < sizeof(feliz) / sizeof(feliz[0]); ++instanceIndex) {
const uint8_t* image = feliz[instanceIndex];
gfx->drawBitmap(0, 0, image, 400, 240, BLACK);
delay(500);
}
delay(10000);
}
Robot-emotion-images.h
#ifndef ROBOTEMOTIONSCONST_H
#define ROBOTEMOTIONSCONST_H
#include <Arduino.h>
#include "base.c"
#include "happy2.c"
#include "happy3.c"
#include "happy4.c"
#include "happy5.c"
#include "happy6.c"
#include "happy7.c"
const uint8_t* feliz[] = {base, happy2, happy3, happy4, happy5, happy6, happy7};
#endif
base.c
/*******************************************************************************
* generated by lcd-image-converter rev.030b30d from 2019-03-17 01:38:34 +0500
* image
* filename: happy.jpg
*
* preset name:
* data block size: 8 bit(s), uint8_t
* RLE compression enabled: no
* conversion type: Monochrome, Diffuse Dither 128
* split to rows: yes
* bits per pixel: 24
*
* preprocess:
* main scan direction: top_to_bottom
* line scan direction: forward
* inverse: no
*******************************************************************************/
#include <stdint.h>
//#include "structData.h"
static const uint8_t base[288000] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
...
I had to remove the content of the array because it was too much for the web.