#include <Arduino.h>
#include <U8g2lib.h> //library at https://github.com/olikraus/U8g2_Arduino
#include <Wire.h> // library required for IIC communication

U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // initialization for the used OLED display

// the arrays below are generated from the image2cpp tool, scroll down for the actual code

// Insert code generated at https://javl.github.io/image2cpp/
const unsigned char epd_bitmap_DOG1 [] PROGMEM = {
// Example
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  };
const unsigned char epd_bitmap_DOG1 [] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const unsigned char epd_bitmap_DOG3 [] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

// Array of all bitmaps for convenience. (Total bytes used to store images in PROGMEM = 3120)
const int epd_bitmap_allArray_LEN = 3;
const unsigned char* epd_bitmap_allArray[3] = {
// Here the Images 
  epd_bitmap_DOG1,
  epd_bitmap_DOG2,
  epd_bitmap_DOG3
};


int counter = 0; // counter for the currently displayed frame of the animation

void setup(void) {
  u8g2.begin(); // start the u8g2 library
}

void loop(void) {

  u8g2.clearBuffer();          // clear the internal memory
  u8g2.drawXBMP(0, 0, 128, 64, epd_bitmap_allArray[counter]); // draw frame of the animation
  u8g2.sendBuffer();          // transfer internal memory to the display

  counter = (counter + 1) % 3; // increase the counter, but always go between 0-27 and the number of img
}