In the ADAFruit code add this variables, pinModes in the setup and replace loop with this one. DON'T delete bmpDraw function.
If this doesn't work let me know which error you receive.
It would work as long as your images are named:
image_X.bmp (for 1 digit)
image_XY.bmp (for 2 digits).
It won't work if first iamges are called image_02.bmp for example.
int bmpcount = 1;
const int bmpmaxnumber = 99; //highest number of bitmaps on your SD.
String bmpname = "image_01.bmp";
const byte prevButton = 3;
const byte nextButton = 4;
int incomingByte = 0; // for incoming serial data
void setup(){
pinMode(prevButton, INPUT);
pinMode(nextButton, INPUT);
bmpDraw("image_1.bmp", 0, 0);
}
void loop(){
if ((prevButton == LOW) && (nextButton == HIGH)) {
//let's go one pic forward
if (bmpcount < bmpmaxnumber){
bmpcount++;
} else {
bmpcount = bmpmaxnumber;
}
bmpname = "image_" + String(bmpcount) + ".bmp";
bmpDraw(bmpname, 0, 0);
}
if ((prevButton == HIGH) && (nextButton == LOW)) {
//let's go one pic back
if (bmpcount > 1){
bmpcount--;
} else {
bmpcount = 1;
}
bmpname = "image_" + String(bmpcount) + ".bmp";
bmpDraw(bmpname, 0, 0);
}
}