Closed gc9n closed 5 years ago
I prefer to keep these kind of questions on other platforms (Stackoverflow, the Arduino forum) as the problem is not specific to this project, there are already many examples of similar problems on those sites and it muddies the issue tracker.
That being said, this should do the trick ;) (don't forget to add the code to load the Adafruit library)
// Define the amount of images we want to use
#define NUM_IMAGES 3
// first [] are the images in our array (we don't have to specify the amount because
// we provide the data as a list { ... }, but as we need the amount later for the for
// loop anyway, I've specified the amount here as well
// second [] is the amount of characters needed for each image, in this case we have 30 chars
// for each image
const unsigned char images[NUM_IMAGES][30] = {
{
0x00, 0x00, 0x00, 0xc0, 0x00, 0xe0, 0x00, 0x30, 0x00, 0x18, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x00,
0x60, 0x00, 0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x0e, 0x00, 0x06, 0x00, 0x00, 0x00
},
{
0x00, 0x00, 0x00, 0x40, 0x00, 0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x0c, 0x00, 0x0c, 0x60, 0x0c,
0x60, 0x00, 0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x00, 0x00
},
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x0c, 0x60, 0x0c, 0x60, 0x0c,
0x60, 0x0c, 0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00
}
};
void setup() {
// put your setup code here, to run once:
}
void loop() {
for (int8_t i = 0; i <= NUM_IMAGES; i++) {
drawBitmap(0, 0, images[i], 15, 15);
}
}
thank you !!!
its not an issue , but i need some help about how to call multiple images
i have 100 array images like that
in order to prevent calling them one by one
how can i call them in a loop?
i need some kind of populated execute function