I'm working on a project involving an Eink display and have to make some modifications. I'm very new to arduino coding, and can't really follow a certain part of the code. I'll paste it here:
define IMAGE_1 cat
define IMAGE_2 dog
define IMAGE_3 apple
define MAKE_STRING1(X) #X
define MAKE_STRING(X) MAKE_STRING1(X)
define ID(X) X
define MAKE_NAME1(X,Y) ID(X##Y)
define MAKE_NAME(X,Y) MAKE_NAME1(X,Y)
define MAKE_JOIN(X,Y) MAKE_STRING(MAKE_NAME(X,Y))
define IMAGE_1_FILE MAKE_JOIN(IMAGE_1,EPD_IMAGE_FILE_SUFFIX)
define IMAGE_1_BITS MAKE_NAME(IMAGE_1,EPD_IMAGE_NAME_SUFFIX)
define IMAGE_2_FILE MAKE_JOIN(IMAGE_2,EPD_IMAGE_FILE_SUFFIX)
define IMAGE_2_BITS MAKE_NAME(IMAGE_2,EPD_IMAGE_NAME_SUFFIX)
define IMAGE_3_FILE MAKE_JOIN(IMAGE_3,EPD_IMAGE_FILE_SUFFIX)
define IMAGE_3_BITS MAKE_NAME(IMAGE_3,EPD_IMAGE_NAME_SUFFIX)
Later on in the code, IMAGE_1_BITS, and the others, are used in a switch to display the images. Can anyone guide me as to what is happening here?
This is basically the demo code that was included in the tutorial. I can add more images if I just followed the syntax but because of our needs, we need to alternate between a hundred or so mages. So declaring all of them, and making a switch with a hundred cases doesn't look like the right way to go.
If anyone has any ideas I would be so greatful. Thanks!