display.begin();//Init Inkplate library (you should call this function ONLY ONCE)
display.clearDisplay();//Clear frame buffer of display
display.drawBitmap3Bit(0,0,pictures[slide],800,600);//Display selected picture at location X=0, Y=0. All three pictures have resolution of 800x600 pixels
display.display();//Refresh the screen with new picture
slide++;//Update counter for pictures. With this variable, we choose what picture is going to be displayed on screen
if(slide>2)
slide=0;//We do not have more than 3 images, so roll back to zero
rtc_gpio_isolate(GPIO_NUM_12);//Isolate/disable GPIO12 on ESP32 (only to reduce power consumption in sleep)
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP*uS_TO_S_FACTOR);//Activate wake-up timer -- wake up after 20s here
esp_deep_sleep_start();//Put ESP32 into deep sleep. Program stops here.