Hello! I am struggling on something that seem simple but I have failed to do. I think I might have missed something fundamental? I tried searching on google, but no luck, might be using wrong keywords? Any help would be greatly appreciated!
Anyway, question is:
I have the a list of bitmaps converted using image2LCD as follows:
const unsigned char icon_1[288]
const unsigned char icon_2[288]
.
.
.
const unsigned char icon_30[288]
int n = 1;
I have inputs that are int n which is 1 -30, how do I display icon(n) when I have int n?
i.e. If I have int n, the display would draw:
display.drawBitmap(x pos, y pos , icon_n ,width, height, color);
display.drawBitmap (x pos, y pos , "icon_" + n ,width, height, color);
-> error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
String str_n = String(n);
display.drawBitmap (x pos, y pos , "icon_" + n ,width, height, color);
-> Gives a bunch of error starting with
error: no matching function for call to 'drawBitmap(int, int, const char*, int, int, uint16_t&)'
char iconname[12];
sprintf (iconname, "icon_%d", n);
-> Gives a bunch of error starting with
error: no matching function for call to 'drawBitmap(int, int, char [12], int, int, uint16_t&)'
... also tried other things I can think of without success.
I am using ADAFRUIT_GFX with GxEPD2. By looking at the errors I think it needs a const uint8_t* as the 3rd argument, how do I do that? What am I missing that I should read more on?
Thank you!