Skip to content

Commit c0bd6c4

Browse files
committed
2 parents e27c458 + 542513f commit c0bd6c4

File tree

36 files changed

+2700
-62
lines changed

36 files changed

+2700
-62
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
Inkplate10_TextBox example for Soldered Inkplate 10
3+
For this example you will need a micro USB cable and an Inkplate 10.
4+
Select "Soldered Inkplate 10" from Tools -> Board menu.
5+
6+
This example will show you how to use the TextBox function with and without special parameters
7+
8+
Want to learn more about Inkplate? Visit www.inkplate.io
9+
Looking to get support? Write on our forums: https://forum.soldered.com/
10+
24 April 2025 by Soldered
11+
*/
12+
13+
#include "Inkplate.h" //Include Inkplate library to the sketch
14+
#include "Roboto_Light_36.h"
15+
Inkplate display(INKPLATE_1BIT); // Create an object on Inkplate library and also set library into 1 Bit mode (BW)
16+
17+
// Define the text you will show in the text box
18+
const char* text="This is an example of a text written in a textbox. When a word doesn't fit into the current row, it goes to the next one."\
19+
" If the text reaches the lower bound, it ends with three dots (...) to mark that the text isnt displayed fully";
20+
21+
void setup()
22+
{
23+
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
24+
display.clearDisplay(); // Clear frame buffer of display
25+
display.display(); // Put clear image on display
26+
27+
// Create a text box without any optional parameters
28+
// x0- x coordinate of upper left corner
29+
// y0- y coordinate of upper left corner
30+
// x1- x coordinate of bottom right corner
31+
// y1- y coordinate of bottom right corner
32+
// text - text we want to display
33+
display.drawTextBox(100,100,300,300,text);
34+
35+
// Create a text box with all parameters
36+
// x0- x coordinate of upper left corner
37+
// y0- y coordinate of upper left corner
38+
// x1- x coordinate of bottom right corner
39+
// y1- y coordinate of bottom right corner
40+
// text - text we want to display
41+
// textSizeMultiplier - by what factor we want to enlarge the size of a font
42+
// font - address of selected custom font
43+
// verticalSpacing - how many pixels between each row of text
44+
// showBorder - Create a visible rectangle around the box
45+
// fontSize - size of the used font in pt
46+
int offset=32; // Note - some custom fonts are drawn from bottom-to-top which requires an offset, use an offset that best suits the font you use
47+
display.drawTextBox(400,100+offset,600,300,text,1,&Roboto_Light_36,27,false,36);
48+
49+
// Display both text boxes
50+
display.display();
51+
}
52+
53+
void loop()
54+
{
55+
// Nothing...
56+
}

examples/Inkplate10/Advanced/Other/Inkplate10_TextBox/Roboto_Light_36.h

Lines changed: 199 additions & 0 deletions
Large diffs are not rendered by default.

examples/Inkplate10/Advanced/WEB_WiFi/Inkplate10_HTTP_With_Certificate/Inkplate10_HTTP_With_Certificate.ino renamed to examples/Inkplate10/Advanced/WEB_WiFi/Inkplate10_HTTPS_With_Certificate/Inkplate10_HTTPS_With_Certificate.ino

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
Inkplate10_Download_Files_With_Certificate example for Soldered Inkplate 7
3-
For this example you will need a micro USB cable, Inkplate 7, and an available WiFi connection.
4-
Select "Soldered Inkplate 7" from Tools -> Board menu.
2+
Inkplate10_HTTPS_With_Certificate example for Soldered Inkplate 10
3+
For this example you will need a micro USB cable, Inkplate 10, and an available WiFi connection.
4+
Select "Soldered Inkplate 10" from Tools -> Board menu.
55
66
You can open .bmp files that have color depth of 1 bit (BW bitmap), 4 bit, 8 bit and
77
24 bit
@@ -27,8 +27,6 @@ const char ssid[] = ""; // Your WiFi SSID
2727
const char *password = ""; // Your WiFi password
2828

2929
//This is the certificate for the website https://varipass.org
30-
//You can find information on how to get the certificate of a website
31-
//as well as how to format it here: https://randomnerdtutorials.com/esp32-https-requests/
3230

3331
const char* certificate = \
3432
"-----BEGIN CERTIFICATE-----\n" \
@@ -83,7 +81,7 @@ void setup()
8381
display.partialUpdate();
8482

8583
//Apply the certificate previously defined
86-
display.applyCertificate(certificate);
84+
display.applyHttpsCertificate(certificate);
8785
//Here we will draw the image using a valid certificate. Photo taken by: Roberto Fernandez
8886
if (!display.drawImage("https://varipass.org/neowise_mono.bmp", 0, 0, false, true))
8987
{

examples/Inkplate2/Advanced/WEB_WiFi/Inkplate2_HTTP_With_Certificate/Inkplate2_HTTP_With_Certificate.ino renamed to examples/Inkplate2/Advanced/WEB_WiFi/Inkplate2_HTTPS_With_Certificate/Inkplate2_HTTPS_With_Certificate.ino

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Inkplate2_Download_Files_With_Certificate example for Soldered Inkplate 2
2+
Inkplate2_HTTPS_With_Certificate example for Soldered Inkplate 2
33
For this example you will need a micro USB cable, Inkplate 2, and an available WiFi connection.
44
Select "Soldered Inkplate 2" from Tools -> Board menu.
55
@@ -27,9 +27,6 @@ const char ssid[] = ""; // Your WiFi SSID
2727
const char *password = ""; // Your WiFi password
2828

2929
//This is the certificate for the website https://varipass.org
30-
//You can find information on how to get the certificate of a website
31-
//as well as how to format it here: https://randomnerdtutorials.com/esp32-https-requests/
32-
3330
const char* certificate = \
3431
"-----BEGIN CERTIFICATE-----\n" \
3532
"MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw\n" \
@@ -83,7 +80,7 @@ void setup()
8380
display.partialUpdate();
8481

8582
//Apply the certificate previously defined
86-
display.applyCertificate(certificate);
83+
display.applyHttpsCertificate(certificate);
8784
//Here we will draw the image using a valid certificate. Photo taken by: Roberto Fernandez
8885
if (!display.drawImage("https://varipass.org/neowise_mono.bmp", 0, 0, false, true))
8986
{
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
Inkplate4_TextBox example for Soldered Inkplate 4
3+
For this example you will need a micro USB cable and an Inkplate 4.
4+
Select "Soldered Inkplate 4" from Tools -> Board menu.
5+
6+
This example will show you how to use the TextBox function with and without special parameters
7+
8+
Want to learn more about Inkplate? Visit www.inkplate.io
9+
Looking to get support? Write on our forums: https://forum.soldered.com/
10+
24 April 2025 by Soldered
11+
*/
12+
13+
#include "Inkplate.h" //Include Inkplate library to the sketch
14+
#include "Roboto_Light_36.h"
15+
Inkplate display(INKPLATE_1BIT); // Create an object on Inkplate library and also set library into 1 Bit mode (BW)
16+
17+
// Define the text you will show in the text box
18+
const char* text="This is an example of a text written in a textbox. When a word doesn't fit into the current row, it goes to the next one."\
19+
" If the text reaches the lower bound, it ends with three dots (...) to mark that the text isnt displayed fully";
20+
21+
void setup()
22+
{
23+
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
24+
display.clearDisplay(); // Clear frame buffer of display
25+
display.display(); // Put clear image on display
26+
27+
// Create a text box without any optional parameters
28+
// x0- x coordinate of upper left corner
29+
// y0- y coordinate of upper left corner
30+
// x1- x coordinate of bottom right corner
31+
// y1- y coordinate of bottom right corner
32+
// text - text we want to display
33+
display.drawTextBox(100,100,300,300,text);
34+
35+
// Create a text box with all parameters
36+
// x0- x coordinate of upper left corner
37+
// y0- y coordinate of upper left corner
38+
// x1- x coordinate of bottom right corner
39+
// y1- y coordinate of bottom right corner
40+
// text - text we want to display
41+
// textSizeMultiplier - by what factor we want to enlarge the size of a font
42+
// font - address of selected custom font
43+
// verticalSpacing - how many pixels between each row of text
44+
// showBorder - Create a visible rectangle around the box
45+
// fontSize - size of the used font in pt
46+
int offset=32; // Note - some custom fonts are drawn from bottom-to-top which requires an offset, use an offset that best suits the font you use
47+
display.drawTextBox(400,100+offset,600,300,text,1,&Roboto_Light_36,27,false,36);
48+
49+
// Display both text boxes
50+
display.display();
51+
}
52+
53+
void loop()
54+
{
55+
// Nothing...
56+
}

0 commit comments

Comments
 (0)