Renamed monochrome -> BW and grayscale -> gray.
This commit is contained in:
parent
49367f07ba
commit
57a406f57a
17
README.md
17
README.md
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
# Inkplate 6 Arduino library
|
# Inkplate 6 Arduino library
|
||||||
|
|
||||||
![](https://www.crowdsupply.com/img/040a/inkplate-6-angle-01_png_project-main.jpg)
|
![](https://www.crowdsupply.com/img/040a/inkplate-6-angle-01_png_project-main.jpg)
|
||||||
|
@ -6,22 +5,24 @@
|
||||||
Arduino library for all-in-one e-paper display Inkplate 6 can be found in this repo. Inkplate 6 is a powerful, Wi-Fi enabled ESP32 based six-inch e-paper display – recycled from a Kindle e-reader. Its main feature is simplicity. Just plug in a USB cable, open Arduino IDE, and change the contents of the screen with few lines of code. Learn more about Inkplate 6 on [Crowd Supply](https://www.crowdsupply.com/e-radionica/inkplate-6).
|
Arduino library for all-in-one e-paper display Inkplate 6 can be found in this repo. Inkplate 6 is a powerful, Wi-Fi enabled ESP32 based six-inch e-paper display – recycled from a Kindle e-reader. Its main feature is simplicity. Just plug in a USB cable, open Arduino IDE, and change the contents of the screen with few lines of code. Learn more about Inkplate 6 on [Crowd Supply](https://www.crowdsupply.com/e-radionica/inkplate-6).
|
||||||
|
|
||||||
### Setting up Inkplate 6 in Arduino IDE
|
### Setting up Inkplate 6 in Arduino IDE
|
||||||
|
|
||||||
In order to get a head start with Inkplate 6, follow these steps:
|
In order to get a head start with Inkplate 6, follow these steps:
|
||||||
|
|
||||||
1. [Install Inkplate 6 board definition](https://e-radionica.com/en/blog/add-inkplate-6-to-arduino-ide/) - add Inkplate 6 as a board into your Arduino IDE. Follow the instructions on the [link](https://e-radionica.com/en/blog/add-inkplate-6-to-arduino-ide/).
|
1. [Install Inkplate 6 board definition](https://e-radionica.com/en/blog/add-inkplate-6-to-arduino-ide/) - add Inkplate 6 as a board into your Arduino IDE. Follow the instructions on the [link](https://e-radionica.com/en/blog/add-inkplate-6-to-arduino-ide/).
|
||||||
2. Install CH340 drivers (if you don't have them yet) - instructions [here](https://e-radionica.com/en/blog/ch340-driver-installation-croduino-basic3-nova2/)
|
2. Install CH340 drivers (if you don't have them yet) - instructions [here](https://e-radionica.com/en/blog/ch340-driver-installation-croduino-basic3-nova2/)
|
||||||
3. Install Inkplate 6 Arduino library - install the library from this repo into your Arduino IDE. If you don't know how, check our [tutorial](https://e-radionica.com/en/blog/arduino-library/#Kako%20instaliraty%20library?).
|
3. Install Inkplate 6 Arduino library - install the library from this repo into your Arduino IDE. If you don't know how, check our [tutorial](https://e-radionica.com/en/blog/arduino-library/#Kako%20instaliraty%20library?).
|
||||||
4. Install [custom SdFat library](https://github.com/e-radionicacom/Inkplate-6-SDFat-Arduino-Library) into your Arduino IDE.
|
4. Install [custom SdFat library](https://github.com/e-radionicacom/Inkplate-6-SDFat-Arduino-Library) into your Arduino IDE.
|
||||||
5. You are ready to get started! Select Tools -> Board -> Inkplate 6, as well as correct COM port and upload!
|
5. You are ready to get started! Select Tools -> Board -> Inkplate 6, as well as correct COM port and upload!
|
||||||
|
|
||||||
|
|
||||||
### Code examples
|
### Code examples
|
||||||
|
|
||||||
There are many examples in the library that you demonstrate how to use any of the Inkplate functionality.
|
There are many examples in the library that you demonstrate how to use any of the Inkplate functionality.
|
||||||
|
|
||||||
1. **Basic Inkplate Functionality**
|
1. **Basic Inkplate Functionality**
|
||||||
|
|
||||||
1.1. Basic Monochrome - use the screen in monochrome mode (graphics & text)
|
1.1. Basic BW - use the screen in BW mode (graphics & text)
|
||||||
|
|
||||||
1.2. Basic Grayscale - use the screen in grayscale mode (graphics & text)
|
1.2. Basic Gray - use the screen in gray mode (graphics & text)
|
||||||
|
|
||||||
1.3. Basic Partial Update - do a partial update of the screen on Inkplate 6
|
1.3. Basic Partial Update - do a partial update of the screen on Inkplate 6
|
||||||
|
|
||||||
|
@ -54,21 +55,27 @@ There are many examples in the library that you demonstrate how to use any of th
|
||||||
3.2. Screen Cleaning - clean the screen in case of image burn-in
|
3.2. Screen Cleaning - clean the screen in case of image burn-in
|
||||||
|
|
||||||
### Using Inkplate 6 with another microcontroller
|
### Using Inkplate 6 with another microcontroller
|
||||||
|
|
||||||
As promised in an [early update](https://www.crowdsupply.com/e-radionica/inkplate-6/updates/successfully-funded-also-third-party-master-controllers-and-partial-updates), Inkplate 6's screen contents can be updated using 3rd controller (such as Raspberry Pi or another microcontroller). The "Slave Mode" (unpopular name right now, we are aware and will change) enables this. All brand new Inkplates come pre-programmed with slave mode and can be used right away.
|
As promised in an [early update](https://www.crowdsupply.com/e-radionica/inkplate-6/updates/successfully-funded-also-third-party-master-controllers-and-partial-updates), Inkplate 6's screen contents can be updated using 3rd controller (such as Raspberry Pi or another microcontroller). The "Slave Mode" (unpopular name right now, we are aware and will change) enables this. All brand new Inkplates come pre-programmed with slave mode and can be used right away.
|
||||||
|
|
||||||
It is based on UART (serial) communication - connect the Inkplate to "master" board either via USB cable or directly via ESP32 RX and TX pins. Using standard UART at 115200 baud, you can send commands to change screen contents. For example, send *#H(000,000,"/img.bmp")** to show image img.bmp from SD card on the screen. Find very basic documentation for using it [here](https://github.com/e-radionicacom/Inkplate-6-Arduino-library/blob/master/examples/4.%20Others/1-Inkplate_Slave_Mode/Inkplate_slave_mode_documentation.txt).
|
It is based on UART (serial) communication - connect the Inkplate to "master" board either via USB cable or directly via ESP32 RX and TX pins. Using standard UART at 115200 baud, you can send commands to change screen contents. For example, send \*#H(000,000,"/img.bmp")\*\* to show image img.bmp from SD card on the screen. Find very basic documentation for using it [here](https://github.com/e-radionicacom/Inkplate-6-Arduino-library/blob/master/examples/4.%20Others/1-Inkplate_Slave_Mode/Inkplate_slave_mode_documentation.txt).
|
||||||
|
|
||||||
### Battery power
|
### Battery power
|
||||||
|
|
||||||
Inkplate 6 has two options for powering it. First one is obvious - USB port at side of the board. Just plug any micro USB cable and you are good to go. Second option is battery. Supported batteries are standard Li-Ion/Li-Poly batteries with 3.7V nominal voltage. Connector for the battery is standard 2.00mm pitch JST connector. The onboard charger will charge the battery with 500mA when USB is plugged at the same time. You can use battery of any size or capacity if you don't have a enclosure. If you are using our enclosure, battery size shouldn't exceed 90mm x 40mm (3.5 x 1.57 inch) and 5mm (0.19 inch) in height. [This battery](https://e-radionica.com/en/li-ion-baterija-1200mah.html) is good fit for the Inkplate.
|
Inkplate 6 has two options for powering it. First one is obvious - USB port at side of the board. Just plug any micro USB cable and you are good to go. Second option is battery. Supported batteries are standard Li-Ion/Li-Poly batteries with 3.7V nominal voltage. Connector for the battery is standard 2.00mm pitch JST connector. The onboard charger will charge the battery with 500mA when USB is plugged at the same time. You can use battery of any size or capacity if you don't have a enclosure. If you are using our enclosure, battery size shouldn't exceed 90mm x 40mm (3.5 x 1.57 inch) and 5mm (0.19 inch) in height. [This battery](https://e-radionica.com/en/li-ion-baterija-1200mah.html) is good fit for the Inkplate.
|
||||||
|
|
||||||
### Micropython
|
### Micropython
|
||||||
|
|
||||||
If you are looking for micropython support, it is still work in progress - we are new with it! :) When it's ready, we will let you know with new project update.
|
If you are looking for micropython support, it is still work in progress - we are new with it! :) When it's ready, we will let you know with new project update.
|
||||||
|
|
||||||
### License
|
### License
|
||||||
|
|
||||||
This repo uses the source code from Adafruit libraries: [MCP23017](https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library), [Adafruit GFX](https://github.com/adafruit/Adafruit-GFX-Library).
|
This repo uses the source code from Adafruit libraries: [MCP23017](https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library), [Adafruit GFX](https://github.com/adafruit/Adafruit-GFX-Library).
|
||||||
|
|
||||||
### Where to buy & other
|
### Where to buy & other
|
||||||
|
|
||||||
Inkplate 6 is available for purchase via:
|
Inkplate 6 is available for purchase via:
|
||||||
|
|
||||||
- [e-radionica.com](https://e-radionica.com/en/inkplate.html)
|
- [e-radionica.com](https://e-radionica.com/en/inkplate.html)
|
||||||
- [Crowd Supply](https://www.crowdsupply.com/e-radionica/inkplate-6)
|
- [Crowd Supply](https://www.crowdsupply.com/e-radionica/inkplate-6)
|
||||||
- [Mouser](https://hr.mouser.com/Search/Refine?Keyword=inkplate)
|
- [Mouser](https://hr.mouser.com/Search/Refine?Keyword=inkplate)
|
||||||
|
|
|
@ -146,7 +146,7 @@ void loop()
|
||||||
display.clearDisplay(); //Clear everytning that is inside frame buffer in ESP32
|
display.clearDisplay(); //Clear everytning that is inside frame buffer in ESP32
|
||||||
displayCurrentAction("Drawing a pixel"); //Function which writes small text at bottom left indicating what's currently done
|
displayCurrentAction("Drawing a pixel"); //Function which writes small text at bottom left indicating what's currently done
|
||||||
//NOTE: you do not need displayCurrentAction function to use Inkplate!
|
//NOTE: you do not need displayCurrentAction function to use Inkplate!
|
||||||
display.drawPixel(100, 50, BLACK); //Draw one black pixel at X = 100, Y = 50 position in BLACK color (must be black since Inkplate is in monochrome mode)
|
display.drawPixel(100, 50, BLACK); //Draw one black pixel at X = 100, Y = 50 position in BLACK color (must be black since Inkplate is in BW mode)
|
||||||
display.display(); //Send image to display. You need to call this one each time you want to transfer frame buffer to the screen.
|
display.display(); //Send image to display. You need to call this one each time you want to transfer frame buffer to the screen.
|
||||||
delay(DELAY_MS); //Wait a little bit
|
delay(DELAY_MS); //Wait a little bit
|
||||||
|
|
||||||
|
@ -351,7 +351,7 @@ void loop()
|
||||||
delay(DELAY_MS);
|
delay(DELAY_MS);
|
||||||
|
|
||||||
//Write same text on different location, but now invert colors (text is white, text background is black), without cleaning the previous text
|
//Write same text on different location, but now invert colors (text is white, text background is black), without cleaning the previous text
|
||||||
display.setTextColor(WHITE, BLACK); //First argument is text color, while second argument is background color. In monochrome, there are
|
display.setTextColor(WHITE, BLACK); //First argument is text color, while second argument is background color. In BW, there are
|
||||||
for (int i = 0; i < 6; i++)
|
for (int i = 0; i < 6; i++)
|
||||||
{ //only two options: BLACK & WHITE
|
{ //only two options: BLACK & WHITE
|
||||||
display.setTextSize(i + 1);
|
display.setTextSize(i + 1);
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
2_Basic_grayscale example for e-radionica.com Inkplate 6
|
2_Basic_gray example for e-radionica.com Inkplate 6
|
||||||
For this example you will need only USB cable and Inkplate 6
|
For this example you will need only USB cable and Inkplate 6
|
||||||
Select "Inkplate 6(ESP32)" from Tools -> Board menu.
|
Select "Inkplate 6(ESP32)" from Tools -> Board menu.
|
||||||
Don't have "Inkplate 6(ESP32)" option? Follow our tutorial and add it:
|
Don't have "Inkplate 6(ESP32)" option? Follow our tutorial and add it:
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
This example will show you how you can draw some simple graphics using
|
This example will show you how you can draw some simple graphics using
|
||||||
Adafruit GFX functions. Yes, Inkplate library is 100% compatible with GFX lib!
|
Adafruit GFX functions. Yes, Inkplate library is 100% compatible with GFX lib!
|
||||||
Learn more about Adafruit GFX: https://learn.adafruit.com/adafruit-gfx-graphics-library
|
Learn more about Adafruit GFX: https://learn.adafruit.com/adafruit-gfx-graphics-library
|
||||||
Inkplate will be used in grayscale mode which is 3 bit, so you can have up to 8 different colors (black, 6 gray
|
Inkplate will be used in gray mode which is 3 bit, so you can have up to 8 different colors (black, 6 gray
|
||||||
colors and white) Color is represented by number, where number 0 means black and number 7 means white, while
|
colors and white) Color is represented by number, where number 0 means black and number 7 means white, while
|
||||||
everything in between are shades of gray.
|
everything in between are shades of gray.
|
||||||
|
|
||||||
|
@ -18,10 +18,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Inkplate.h" //Include Inkplate library to the sketch
|
#include "Inkplate.h" //Include Inkplate library to the sketch
|
||||||
#include "image.h" //Include image file that holds grayscale image data. You can see it in next tab inside Arduino IDE.
|
#include "image.h" //Include image file that holds gray image data. You can see it in next tab inside Arduino IDE.
|
||||||
Inkplate display(INKPLATE_3BIT); // Create object on Inkplate library and set library to work in grayscale mode (3-bit)
|
Inkplate display(INKPLATE_3BIT); // Create object on Inkplate library and set library to work in gray mode (3-bit)
|
||||||
// Other option is monochrome mode, which is demonstrated in next example
|
// Other option is BW mode, which is demonstrated in next example
|
||||||
// "2-Inkplate_basic_monochrome"
|
// "2-Inkplate_basic_BW"
|
||||||
|
|
||||||
#define DELAY_MS \
|
#define DELAY_MS \
|
||||||
5000 //Delay in milliseconds between screen refresh. Refreshing e-paper screens more often than 5s is not recommended \
|
5000 //Delay in milliseconds between screen refresh. Refreshing e-paper screens more often than 5s is not recommended \
|
||||||
|
@ -359,7 +359,7 @@ void loop()
|
||||||
delay(DELAY_MS);
|
delay(DELAY_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Did you know that you can change between monochrome and greyscale mode anytime?
|
// Did you know that you can change between BW and greyscale mode anytime?
|
||||||
// Just call Inkplate display(INKPLATE_1BIT) or Inkplate display(INKPLATE_3BIT)
|
// Just call Inkplate display(INKPLATE_1BIT) or Inkplate display(INKPLATE_3BIT)
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
In this example we will show how to use partial update functionality of Inkplate 6 e-paper display.
|
In this example we will show how to use partial update functionality of Inkplate 6 e-paper display.
|
||||||
It will scroll text that is saved in char array
|
It will scroll text that is saved in char array
|
||||||
NOTE: Partial update is only available on 1 Bit mode (Monochrome) and it is not recommended to use it on first refresh after power up.
|
NOTE: Partial update is only available on 1 Bit mode (BW) and it is not recommended to use it on first refresh after power up.
|
||||||
It is recommended to do a full refresh every 5-10 partial refresh to maintain good picture quality.
|
It is recommended to do a full refresh every 5-10 partial refresh to maintain good picture quality.
|
||||||
|
|
||||||
Want to learn more about Inkplate? Visit www.inkplate.io
|
Want to learn more about Inkplate? Visit www.inkplate.io
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Inkplate.h" //Include Inkplate library to the sketch
|
#include "Inkplate.h" //Include Inkplate library to the sketch
|
||||||
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1-bit mode (Monochrome)
|
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1-bit mode (BW)
|
||||||
|
|
||||||
//Char array where you can store your text that will be scrolled.
|
//Char array where you can store your text that will be scrolled.
|
||||||
const char text[] = "This is partial update on Inkplate 6 e-paper display! :)";
|
const char text[] = "This is partial update on Inkplate 6 e-paper display! :)";
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "Inkplate.h" //Include Inkplate library to the sketch
|
#include "Inkplate.h" //Include Inkplate library to the sketch
|
||||||
#include "Not_Just_Groovy20pt7b.h" //Include first .h font file to the sketch
|
#include "Not_Just_Groovy20pt7b.h" //Include first .h font file to the sketch
|
||||||
#include "DSEG14Classic_Regular20pt7b.h" //Include second font
|
#include "DSEG14Classic_Regular20pt7b.h" //Include second font
|
||||||
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1-bit mode (Monochrome)
|
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1-bit mode (BW)
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#define pass "" // Password of that WiFi network
|
#define pass "" // Password of that WiFi network
|
||||||
|
|
||||||
Inkplate display(
|
Inkplate display(
|
||||||
INKPLATE_1BIT); // Create an object on Inkplate library and also set library into 1 Bit mode (Monochrome)
|
INKPLATE_1BIT); // Create an object on Inkplate library and also set library into 1 Bit mode (BW)
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,7 @@ const uint8_t *pictures[] = {pic1, pic2, pic3}; //This array of pinters holds ad
|
||||||
#define TIME_TO_SLEEP 20 //How long ESP32 will be in deep sleep (in seconds)
|
#define TIME_TO_SLEEP 20 //How long ESP32 will be in deep sleep (in seconds)
|
||||||
RTC_DATA_ATTR int slide = 0;
|
RTC_DATA_ATTR int slide = 0;
|
||||||
|
|
||||||
Inkplate display(INKPLATE_3BIT); //Create an object on Inkplate library and also set library into 3 Bit mode (Grayscale)
|
Inkplate display(INKPLATE_3BIT); //Create an object on Inkplate library and also set library into 3 Bit mode (gray)
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "Inkplate.h" //Include Inkplate library to the sketch
|
#include "Inkplate.h" //Include Inkplate library to the sketch
|
||||||
#include "symbols.h" //Include .h file that contains byte array for battery symbol and temperature symbol.
|
#include "symbols.h" //Include .h file that contains byte array for battery symbol and temperature symbol.
|
||||||
//It is in same folder as this sketch. You can even open it (read it) by clicking on symbols.h tab in Arduino IDE
|
//It is in same folder as this sketch. You can even open it (read it) by clicking on symbols.h tab in Arduino IDE
|
||||||
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1-bit mode (Monochrome)
|
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1-bit mode (BW)
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Inkplate.h" //Include Inkplate library to the sketch
|
#include "Inkplate.h" //Include Inkplate library to the sketch
|
||||||
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1 Bit mode (Monochrome)
|
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1 Bit mode (BW)
|
||||||
|
|
||||||
int number = 0; //Variable that stores our number
|
int number = 0; //Variable that stores our number
|
||||||
int n = 0; //Variable that keeps track on how many times display is partially updated
|
int n = 0; //Variable that keeps track on how many times display is partially updated
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
To work with SD card on Inkplate, you will need to add one extra library.
|
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
|
Download and install it from here: https://github.com/e-radionicacom/Inkplate-6-SDFat-Arduino-Library
|
||||||
|
|
||||||
You can open .bmp files that have color depth of 1 bit (monochrome bitmap), 4 bit, 8 bit and
|
You can open .bmp files that have color depth of 1 bit (BW bitmap), 4 bit, 8 bit and
|
||||||
24 bit AND have resoluton smaller than 800x600 or otherwise it won't fit on screen.
|
24 bit AND have resoluton smaller than 800x600 or otherwise it won't fit on screen.
|
||||||
Format your SD card in standard FAT fileformat.
|
Format your SD card in standard FAT fileformat.
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
#include "Inkplate.h" //Include Inkplate library to the sketch
|
#include "Inkplate.h" //Include Inkplate library to the sketch
|
||||||
#include "SdFat.h" //Include library for SD card
|
#include "SdFat.h" //Include library for SD card
|
||||||
Inkplate display(
|
Inkplate display(
|
||||||
INKPLATE_1BIT); // Create an object on Inkplate library and also set library into 1 Bit mode (Monochrome)
|
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
|
SdFile file; // Create SdFile object used for accessing files on SD card
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "Inkplate.h" //Include Inkplate library to the sketch
|
#include "Inkplate.h" //Include Inkplate library to the sketch
|
||||||
#include "SdFat.h" //Include library for SD card
|
#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 (Monochrome)
|
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
|
SdFile file; //Create SdFile object used for accessing files on SD card
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include <Adafruit_Sensor.h> //Adafruit library for sensors
|
#include <Adafruit_Sensor.h> //Adafruit library for sensors
|
||||||
#include "Adafruit_BME680.h" //Adafruit library for BME680 Sensor
|
#include "Adafruit_BME680.h" //Adafruit library for BME680 Sensor
|
||||||
|
|
||||||
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1 Bit mode (Monochrome)
|
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1 Bit mode (BW)
|
||||||
Adafruit_BME680 bme; //Create an object on Adafruit BME680 library
|
Adafruit_BME680 bme; //Create an object on Adafruit BME680 library
|
||||||
//(with no arguments sent to constructor, that means we are using I2C communication for BME680 sensor)
|
//(with no arguments sent to constructor, that means we are using I2C communication for BME680 sensor)
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
#define LED_PIN 15 //We are going to use pin GPB7 (remember! GPA0 = 0, GPA1 = 1, ..., GPA7 = 7, GPB0 = 8, GBP1 = 9, ..., GPB7 = 15)
|
#define LED_PIN 15 //We are going to use pin GPB7 (remember! GPA0 = 0, GPA1 = 1, ..., GPA7 = 7, GPB0 = 8, GBP1 = 9, ..., GPB7 = 15)
|
||||||
|
|
||||||
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1-bit mode (Monochrome)
|
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1-bit mode (BW)
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#define ssid "Inkplate6"
|
#define ssid "Inkplate6"
|
||||||
#define pass "e-radionica"
|
#define pass "e-radionica"
|
||||||
|
|
||||||
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1 Bit mode (Monochrome)
|
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1 Bit mode (BW)
|
||||||
WebServer server(80); //Create Web server on port 80 (HTTP port number)
|
WebServer server(80); //Create Web server on port 80 (HTTP port number)
|
||||||
|
|
||||||
IPAddress serverIP;
|
IPAddress serverIP;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
Don't have "Inkplate 6(ESP32)" option? Follow our tutorial and add it:
|
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/
|
https://e-radionica.com/en/blog/add-inkplate-6-to-arduino-ide/
|
||||||
|
|
||||||
You can open .bmp files that have color depth of 1 bit (monochrome bitmap), 4 bit, 8 bit and
|
You can open .bmp files that have color depth of 1 bit (BW bitmap), 4 bit, 8 bit and
|
||||||
24 bit AND have resoluton smaller than 800x600 or otherwise it won't fit on screen.
|
24 bit AND have resoluton smaller than 800x600 or otherwise it won't fit on screen.
|
||||||
|
|
||||||
This example will show you how you can download a .bmp file (picture) from the web and
|
This example will show you how you can download a .bmp file (picture) from the web and
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
#include "Inkplate.h" //Include Inkplate library to the sketch
|
#include "Inkplate.h" //Include Inkplate library to the sketch
|
||||||
#include "HTTPClient.h" //Include library for HTTPClient
|
#include "HTTPClient.h" //Include library for HTTPClient
|
||||||
#include "WiFi.h" //Include library for WiFi
|
#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 (Monochrome)
|
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 *ssid = ""; //Your WiFi SSID
|
||||||
const char *password = ""; //Your WiFi password
|
const char *password = ""; //Your WiFi password
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "Inkplate.h" //Include Inkplate library to the sketch
|
#include "Inkplate.h" //Include Inkplate library to the sketch
|
||||||
#include "SdFat.h" //Include library for SD card
|
#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 (Monochrome)
|
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
|
SdFile file; // Create SdFile object used for accessing files on SD card
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
|
|
|
@ -18,12 +18,13 @@
|
||||||
#include "Inkplate.h" //Include Inkplate library to the sketch
|
#include "Inkplate.h" //Include Inkplate library to the sketch
|
||||||
#include "HTTPClient.h" //Include library for HTTPClient
|
#include "HTTPClient.h" //Include library for HTTPClient
|
||||||
#include "WiFi.h" //Include library for WiFi
|
#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 (Monochrome)
|
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 *ssid = ""; //Your WiFi SSID
|
||||||
const char* password = ""; //Your WiFi password
|
const char *password = ""; //Your WiFi password
|
||||||
|
|
||||||
void setup() {
|
void setup()
|
||||||
|
{
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
display.begin(); //Init Inkplate library (you should call this function ONLY ONCE)
|
display.begin(); //Init Inkplate library (you should call this function ONLY ONCE)
|
||||||
display.clearDisplay(); //Clear frame buffer of display
|
display.clearDisplay(); //Clear frame buffer of display
|
||||||
|
@ -35,7 +36,8 @@ void setup() {
|
||||||
//Connect to the WiFi network.
|
//Connect to the WiFi network.
|
||||||
WiFi.mode(WIFI_MODE_STA);
|
WiFi.mode(WIFI_MODE_STA);
|
||||||
WiFi.begin(ssid, password);
|
WiFi.begin(ssid, password);
|
||||||
while (WiFi.status() != WL_CONNECTED) {
|
while (WiFi.status() != WL_CONNECTED)
|
||||||
|
{
|
||||||
delay(500);
|
delay(500);
|
||||||
display.print(".");
|
display.print(".");
|
||||||
display.partialUpdate();
|
display.partialUpdate();
|
||||||
|
@ -48,7 +50,8 @@ void setup() {
|
||||||
//NOTE: Both drawJpegFromWeb methods allow for an optional sisxth "invert" parameter. Setting this parameter to true
|
//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.
|
//will flip all colors on the image, making black white and white black.
|
||||||
//fifth parameter will dither the image.
|
//fifth parameter will dither the image.
|
||||||
if (!display.drawJpegFromWeb(&display, "https://varipass.org/destination.jpg", 0, 100, true, false)) {
|
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.
|
//If is something failed (wrong filename or format), write error message on the screen.
|
||||||
display.println("Image open error");
|
display.println("Image open error");
|
||||||
display.display();
|
display.display();
|
||||||
|
@ -58,6 +61,7 @@ void setup() {
|
||||||
WiFi.mode(WIFI_OFF);
|
WiFi.mode(WIFI_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop()
|
||||||
|
{
|
||||||
//Nothing...
|
//Nothing...
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,12 +26,13 @@
|
||||||
|
|
||||||
#include "Inkplate.h" //Include Inkplate library to the sketch
|
#include "Inkplate.h" //Include Inkplate library to the sketch
|
||||||
#include "WiFi.h" //Include library for WiFi
|
#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 (Monochrome)
|
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1 Bit mode (BW)
|
||||||
|
|
||||||
const char* ssid = "YourWiFiSSID"; //Your WiFi SSID
|
const char *ssid = "YourWiFiSSID"; //Your WiFi SSID
|
||||||
const char* password = "YourPass"; //Your WiFi password
|
const char *password = "YourPass"; //Your WiFi password
|
||||||
|
|
||||||
void setup() {
|
void setup()
|
||||||
|
{
|
||||||
display.begin(); //Init Inkplate library (you should call this function ONLY ONCE)
|
display.begin(); //Init Inkplate library (you should call this function ONLY ONCE)
|
||||||
display.clearDisplay(); //Clear frame buffer of display
|
display.clearDisplay(); //Clear frame buffer of display
|
||||||
display.display(); //Put clear image on display
|
display.display(); //Put clear image on display
|
||||||
|
@ -42,7 +43,8 @@ void setup() {
|
||||||
//Connect to the WiFi network.
|
//Connect to the WiFi network.
|
||||||
WiFi.mode(WIFI_MODE_STA);
|
WiFi.mode(WIFI_MODE_STA);
|
||||||
WiFi.begin(ssid, password);
|
WiFi.begin(ssid, password);
|
||||||
while (WiFi.status() != WL_CONNECTED) {
|
while (WiFi.status() != WL_CONNECTED)
|
||||||
|
{
|
||||||
delay(500);
|
delay(500);
|
||||||
display.print(".");
|
display.print(".");
|
||||||
display.partialUpdate();
|
display.partialUpdate();
|
||||||
|
@ -57,9 +59,10 @@ void setup() {
|
||||||
// but a "key" parameter should also be specified if not.
|
// but a "key" parameter should also be specified if not.
|
||||||
// width - Width of the generated graph, here set to half the Inkplate's width.
|
// width - Width of the generated graph, here set to half the Inkplate's width.
|
||||||
// height - Height of the generated graph, here set to half the Inkplate's height.
|
// height - Height of the generated graph, here set to half the Inkplate's height.
|
||||||
// eink - Should be set to true to generate a monochrome 1 bit bitmap better suitable for Inkplate.
|
// eink - Should be set to true to generate a BW 1 bit bitmap better suitable for Inkplate.
|
||||||
// For more detailed explanation and more parameters, please visit the docs page: https://varipass.org/docs/
|
// For more detailed explanation and more parameters, please visit the docs page: https://varipass.org/docs/
|
||||||
if(!display.drawBitmapFromWeb("https://api.varipass.org/?action=sgraph&id=kbg3eQfA&width=400&height=300&eink=true", 200, 150)) {
|
if (!display.drawBitmapFromWeb("https://api.varipass.org/?action=sgraph&id=kbg3eQfA&width=400&height=300&eink=true", 200, 150))
|
||||||
|
{
|
||||||
display.println("Image open error");
|
display.println("Image open error");
|
||||||
display.partialUpdate();
|
display.partialUpdate();
|
||||||
}
|
}
|
||||||
|
@ -68,6 +71,7 @@ void setup() {
|
||||||
WiFi.mode(WIFI_OFF);
|
WiFi.mode(WIFI_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop()
|
||||||
|
{
|
||||||
//Nothing...
|
//Nothing...
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,10 +24,9 @@
|
||||||
#define pgm_read_pointer(addr) ((void *)pgm_read_word(addr))
|
#define pgm_read_pointer(addr) ((void *)pgm_read_word(addr))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
class Graphics : public Shapes, public Image
|
class Graphics : public Shapes, public Image
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Graphics(int16_t w, int16_t h) : Adafruit_GFX(w, h), Shapes(w, h), Image(w, h){};
|
Graphics(int16_t w, int16_t h) : Adafruit_GFX(w, h), Shapes(w, h), Image(w, h){};
|
||||||
|
|
||||||
void setRotation(uint8_t r);
|
void setRotation(uint8_t r);
|
||||||
|
@ -62,7 +61,7 @@ class Graphics : public Shapes, public Image
|
||||||
|
|
||||||
uint8_t _blockPartial = 1;
|
uint8_t _blockPartial = 1;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void startWrite(void) override;
|
void startWrite(void) override;
|
||||||
void writePixel(int16_t x, int16_t y, uint16_t color) override;
|
void writePixel(int16_t x, int16_t y, uint16_t color) override;
|
||||||
void writeFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) override;
|
void writeFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) override;
|
||||||
|
@ -73,7 +72,7 @@ class Graphics : public Shapes, public Image
|
||||||
|
|
||||||
uint8_t _displayMode = 0;
|
uint8_t _displayMode = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue