Making a e-Paper desk clock using:
4.2" Waveshare e-Paper monochrome display
Arcade button (to select next image)
4-digit TM 1637 clock display
RTC DS3231
Arduino Mega
Using the GXEPD2 library to load an image file from an SD to display - rather than naming each file and using a drawBitmapFromSD("BreakingBad.bmp", w2 - 200, h2 - 150); command followed by a millis() delay - is there a way to store images to an SD in sequential fashion, then have a pointer look for the last image named, "9999.bmp" or something like that to have the code trigger a return to the first image for infinite recycling? That way I can pull the SD out to add more images at any time..
Perhaps someone has done this and has example code? I don't see this specific inquiry.
look at the listfiles.ino examle that comes with the SD library. It marches through all the files on the SD card, displaying their name. Adapt it to fit your needs.
Did you look at the the example I mentioned? It doesn't require building up a filename like "imageXXX.bmp" to work. It just steps through the directory listing. When you do it that way, the order of the files are the order they are written to the SD card, not alphabetical or anything like that. If you want them to display in a specific order, then you either have to write them to the SD card in that order or do what you suggested and build up a filename and test to see if that file exists or not.
If you do want to build up filenames, look at snprintf() and avoid the String class on small memory devices like the Mega.
Order sure, but using a routine I want to stepwise check each filename first, "imageXXX.bmp" - and if it is "image999.bmp" - reset to "image001.bmp". Otherwise go and display "imageXXX.bmp" to e-Paper until the next image change, +XXX; triggered by either a button press or at midnight ping from RTC.
I'll have a deeper look at that example- your idea could work as long as I can trigger the stepping through to start back at the top after the directory had been gone through- maybe it defaults? Good idea though, if there's a missing file in the sequence, no stumbling then!
If you are numbering the images sequentially, you can just increment the number in the file name, check to see if the file exists, and if not then reset the number to 0 and start over from there.