Peggy2 Slide Show Update

I uploaded an update to my Slide Show sketch for the Peggy2. Someone who downloaded it emailed me and said he had problems adding a fourth slide. I was quite puzzled because his code looked fine, but when I loaded his modified program into my Peggy2, nothing happened. In fact, I thought that my hardware had died.

After checking all the hardware (a hundred times), I thought maybe it was not dead, but just crashed. I tried uploading a program to it during the brief time after power-on that the Peggy checks for uploads before running the program. I had to do that a couple of times to get the timing just right so it would take the upload.

The problem with the program was the variable that holds the array of image data. I did some research and found that variables are stored in RAM, not flash program memory. So, it overran the available RAM. It would be nice if the compiler could catch that, but it doesn't. The fix was to store the array in program memory, not RAM. That required a bit of research too, but it turned out to be fairly simple.