diff --git a/examples/Advanced Inkplate Features/Inkplate_SD_JPEG_pictures/Inkplate_SD_JPEG_pictures.ino b/examples/Advanced Inkplate Features/Inkplate_SD_JPEG_pictures/Inkplate_SD_JPEG_pictures.ino deleted file mode 100644 index b381d08..0000000 --- a/examples/Advanced Inkplate Features/Inkplate_SD_JPEG_pictures/Inkplate_SD_JPEG_pictures.ino +++ /dev/null @@ -1,69 +0,0 @@ -/* - 5_Inkplate_SD_JPEG_pictures example for e-radionica Inkplate6 - For this example you will need a micro USB cable, Inkplate6 and a SD card loaded with - pyramid.jpg file that can be found inside folder of this example. - Select "Inkplate 6(ESP32)" from Tools -> Board menu. - Don't have "Inkplate 6(ESP32)" option? Follow our tutorial and add it: - https://e-radionica.com/en/blog/add-inkplate-6-to-arduino-ide/ - - To work with SD card on Inkplate, you will need to add one extra library. - Download and install it from here: https://github.com/e-radionicacom/Inkplate-6-SDFat-Arduino-Library - - You can open .jpg files that have resoluton smaller than 800x600 or otherwise it won't fit on screen. - Format your SD card in standard FAT fileformat. - - This example will show you how you can read a .jpg file (picture) from SD card and - display that image on e-paper display. - - Want to learn more about Inkplate? Visit www.inkplate.io - Looking to get support? Write on our forums: http://forum.e-radionica.com/en/ - 31 August 2020 by e-radionica.com -*/ - -#include "Inkplate.h" //Include Inkplate library to the sketch -#include "SdFat.h" //Include library for SD card - -Inkplate display(INKPLATE_1BIT); // Create an object on Inkplate library and also set library into 1 Bit mode (BW) -SdFile file; // Create SdFile object used for accessing files on SD card - -void setup() -{ - display.begin(); // Init Inkplate library (you should call this function ONLY ONCE) - display.clearDisplay(); // Clear frame buffer of display - display.display(); // Put clear image on display - - // Init SD card. Display if SD card is init propery or not. - if (display.sdCardInit()) - { - display.println("SD Card OK! Reading image..."); - display.partialUpdate(); - - // If card is properly init, try to load image and display it on e-paper at position X=100, Y=0 - // NOTE: These methods require you to pass a reference to the display object as first parameter. - // NOTE: Both drawJpegFromSd methods allow for an optional sixth "invert" parameter. Setting this parameter to - // true will flip all colors on the image, making black white and white black. fifth parameter will dither the - // image. - if (!display.drawJpegFromSd(&display, "pyramid.jpg", 100, 0, true, false)) - { - // If is something failed (wrong filename or wrong format), write error message on the screen. - // You can turn off dithering for somewhat faster image load by changing the fifth parameter to false, or - // removing the parameter completely - display.println("Image open error"); - display.display(); - } - display.display(); - } - else - { - // If SD card init not success, display error on screen and stop the program (using infinite loop) - display.println("SD Card error!"); - display.partialUpdate(); - while (true) - ; - } -} - -void loop() -{ - // Nothing... -} diff --git a/examples/Advanced Inkplate Features/Inkplate_SD_BMP_pictures/Inkplate_SD_BMP_pictures.ino b/examples/Advanced Inkplate Features/Inkplate_SD_pictures/Inkplate_SD_pictures.ino similarity index 87% rename from examples/Advanced Inkplate Features/Inkplate_SD_BMP_pictures/Inkplate_SD_BMP_pictures.ino rename to examples/Advanced Inkplate Features/Inkplate_SD_pictures/Inkplate_SD_pictures.ino index eaf1289..5300ed5 100644 --- a/examples/Advanced Inkplate Features/Inkplate_SD_BMP_pictures/Inkplate_SD_BMP_pictures.ino +++ b/examples/Advanced Inkplate Features/Inkplate_SD_pictures/Inkplate_SD_pictures.ino @@ -71,6 +71,20 @@ void setup() display.drawBitmapFromSd(&file, 0, 0); display.display(); } + + display.clearDisplay(); + delay(3000); + + // Now draw a JPEG + if (!display.drawImage("pyramid.jpg", 100, 0, true, false)) + { + // If is something failed (wrong filename or wrong format), write error message on the screen. + // You can turn off dithering for somewhat faster image load by changing the fifth parameter to false, or + // removing the parameter completely + display.println("Image open error"); + display.display(); + } + display.display(); } void loop() diff --git a/examples/Advanced Inkplate Features/Inkplate_SD_BMP_pictures/image1.bmp b/examples/Advanced Inkplate Features/Inkplate_SD_pictures/image1.bmp similarity index 100% rename from examples/Advanced Inkplate Features/Inkplate_SD_BMP_pictures/image1.bmp rename to examples/Advanced Inkplate Features/Inkplate_SD_pictures/image1.bmp diff --git a/examples/Advanced Inkplate Features/Inkplate_SD_BMP_pictures/image2.bmp b/examples/Advanced Inkplate Features/Inkplate_SD_pictures/image2.bmp similarity index 100% rename from examples/Advanced Inkplate Features/Inkplate_SD_BMP_pictures/image2.bmp rename to examples/Advanced Inkplate Features/Inkplate_SD_pictures/image2.bmp diff --git a/examples/Advanced Inkplate Features/Inkplate_SD_JPEG_pictures/pyramid.jpg b/examples/Advanced Inkplate Features/Inkplate_SD_pictures/pyramid.jpg similarity index 100% rename from examples/Advanced Inkplate Features/Inkplate_SD_JPEG_pictures/pyramid.jpg rename to examples/Advanced Inkplate Features/Inkplate_SD_pictures/pyramid.jpg diff --git a/examples/Advanced Inkplate Features/Inkplate_Web_JPEG_pictures/Inkplate_Web_JPEG_pictures.ino b/examples/Advanced Inkplate Features/Inkplate_Web_JPEG_pictures/Inkplate_Web_JPEG_pictures.ino deleted file mode 100644 index 52522f2..0000000 --- a/examples/Advanced Inkplate Features/Inkplate_Web_JPEG_pictures/Inkplate_Web_JPEG_pictures.ino +++ /dev/null @@ -1,67 +0,0 @@ -/* - 12-Inkplate_Web_JPEG_pictures for e-radionica Inkplate6 - For this example you will need a micro USB cable, Inkplate6, and an available WiFi connection. - Select "Inkplate 6(ESP32)" from Tools -> Board menu. - Don't have "Inkplate 6(ESP32)" option? Follow our tutorial and add it: - https://e-radionica.com/en/blog/add-inkplate-6-to-arduino-ide/ - - You can open .jpg files that have resoluton smaller than 800x600 or otherwise it won't fit on screen. - - This example will show you how you can download a .jpg file (picture) from the web and - display that image on e-paper display. - - Want to learn more about Inkplate? Visit www.inkplate.io - Looking to get support? Write on our forums: http://forum.e-radionica.com/en/ - 31 August 2020 by e-radionica.com -*/ - -#include "Inkplate.h" //Include Inkplate library to the sketch -#include "HTTPClient.h" //Include library for HTTPClient -#include "WiFi.h" //Include library for WiFi -Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1 Bit mode (BW) - -const char *ssid = ""; //Your WiFi SSID -const char *password = ""; //Your WiFi password - -void setup() -{ - Serial.begin(115200); - display.begin(); //Init Inkplate library (you should call this function ONLY ONCE) - display.clearDisplay(); //Clear frame buffer of display - display.display(); //Put clear image on display - - display.print("Connecting to WiFi..."); - display.partialUpdate(); - - //Connect to the WiFi network. - WiFi.mode(WIFI_MODE_STA); - WiFi.begin(ssid, password); - while (WiFi.status() != WL_CONNECTED) - { - delay(500); - display.print("."); - display.partialUpdate(); - } - display.println("\nWiFi OK! Downloading..."); - display.partialUpdate(); - - //Try to load image and display it on e-paper at position X=0, Y=100 - //NOTE: These methods require you to pass a reference to the display object as first parameter. - //NOTE: Both drawJpegFromWeb methods allow for an optional sisxth "invert" parameter. Setting this parameter to true - //will flip all colors on the image, making black white and white black. - //fifth parameter will dither the image. - if (!display.drawJpegFromWeb(&display, "https://varipass.org/destination.jpg", 0, 100, true, false)) - { - //If is something failed (wrong filename or format), write error message on the screen. - display.println("Image open error"); - display.display(); - } - display.display(); - - WiFi.mode(WIFI_OFF); -} - -void loop() -{ - //Nothing... -} diff --git a/examples/Advanced Inkplate Features/Inkplate_Web_BMP_pictures/Inkplate_Web_BMP_pictures.ino b/examples/Advanced Inkplate Features/Inkplate_Web_Pictures/Inkplate_Web_Pictures.ino similarity index 86% rename from examples/Advanced Inkplate Features/Inkplate_Web_BMP_pictures/Inkplate_Web_BMP_pictures.ino rename to examples/Advanced Inkplate Features/Inkplate_Web_Pictures/Inkplate_Web_Pictures.ino index 3aaf312..efdcd37 100644 --- a/examples/Advanced Inkplate Features/Inkplate_Web_BMP_pictures/Inkplate_Web_BMP_pictures.ino +++ b/examples/Advanced Inkplate Features/Inkplate_Web_Pictures/Inkplate_Web_Pictures.ino @@ -99,6 +99,21 @@ void setup() display.display(); } + display.clearDisplay(); + delay(3000); + + // Try to load image and display it on e-paper at position X=0, Y=100 + // NOTE: Both drawJpegFromWeb methods allow for an optional fifth "invert" parameter. Setting this parameter to + // true will flip all colors on the image, making black white and white black. forth parameter will dither the + // image. + if (!display.drawImage("https://varipass.org/destination.jpg", 0, 100, true, false)) + { + // If is something failed (wrong filename or format), write error message on the screen. + display.println("Image open error"); + display.display(); + } + display.display(); + http.end(); WiFi.mode(WIFI_OFF); diff --git a/examples/Advanced Inkplate Features/Inkplate_Web_Pictures/destination.jpg b/examples/Advanced Inkplate Features/Inkplate_Web_Pictures/destination.jpg new file mode 100644 index 0000000..c83307c Binary files /dev/null and b/examples/Advanced Inkplate Features/Inkplate_Web_Pictures/destination.jpg differ diff --git a/examples/Advanced Inkplate Features/Inkplate_Web_BMP_pictures/neowise.bmp b/examples/Advanced Inkplate Features/Inkplate_Web_Pictures/neowise.bmp similarity index 100% rename from examples/Advanced Inkplate Features/Inkplate_Web_BMP_pictures/neowise.bmp rename to examples/Advanced Inkplate Features/Inkplate_Web_Pictures/neowise.bmp diff --git a/examples/Advanced Inkplate Features/Inkplate_Web_BMP_pictures/neowise_mono.bmp b/examples/Advanced Inkplate Features/Inkplate_Web_Pictures/neowise_mono.bmp similarity index 100% rename from examples/Advanced Inkplate Features/Inkplate_Web_BMP_pictures/neowise_mono.bmp rename to examples/Advanced Inkplate Features/Inkplate_Web_Pictures/neowise_mono.bmp