Skip to content

Commit 23ba633

Browse files
authored
Merge pull request #247 from SolderedElectronics/Inkplate5V2_examples
Added Inkplate5V2 examples.
2 parents b5311f2 + 8a45bb0 commit 23ba633

File tree

377 files changed

+117162
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

377 files changed

+117162
-27
lines changed

examples/Inkplate10/Advanced/WEB_WiFi/Inkplate10_Show_JPG_With_HTTPClient/Inkplate10_Show_JPG_With_HTTPClient.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ char *ssid = ""; // Your WiFi SSID
3333
char *pass = ""; // Your WiFi password
3434

3535
// Add the URL of the image you want to show on Inkplate
36-
String url = "https://raw.githubusercontent.com/SolderedElectronics/Inkplate-Arduino-library/dev/examples/Inkplate10/Advanced/WEB_WiFi/Inkplate10_Show_JPG_With_HTTPClient/image.jpg";
36+
String url = "https://raw.githubusercontent.com/SolderedElectronics/Inkplate-Arduino-library/master/examples/Inkplate10/Advanced/WEB_WiFi/Inkplate10_Show_JPG_With_HTTPClient/image.jpg";
3737

3838
/***********************************************/
3939

examples/Inkplate2/Advanced/WEB_WiFi/Inkplate2_Show_JPG_With_HTTPClient/Inkplate2_Show_JPG_With_HTTPClient.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ char *ssid = ""; // Your WiFi SSID
3232
char *pass = ""; // Your WiFi password
3333

3434
// Add the URL of the image you want to show on Inkplate
35-
String url = "https://raw.githubusercontent.com/SolderedElectronics/Inkplate-Arduino-library/dev/examples/Inkplate2/Advanced/WEB_WiFi/Inkplate2_Show_JPG_With_HTTPClient/image.jpg";
35+
String url = "https://raw.githubusercontent.com/SolderedElectronics/Inkplate-Arduino-library/master/examples/Inkplate2/Advanced/WEB_WiFi/Inkplate2_Show_JPG_With_HTTPClient/image.jpg";
3636

3737
/***********************************************/
3838

examples/Inkplate2/Advanced/WEB_WiFi/Inkplate2_Show_Pictures_From_Web/Inkplate2_Show_Pictures_From_Web.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void setup()
6868
display.clearDisplay();
6969

7070
if (!display.drawImage("https://raw.githubusercontent.com/SolderedElectronics/Inkplate-Arduino-library/"
71-
"Inkplate2-DrawImage3Color-And-Examples/examples/Inkplate2/Advanced/WEB_WiFi/"
71+
"master/examples/Inkplate2/Advanced/WEB_WiFi/"
7272
"Inkplate2_Show_Pictures_From_Web/cat_dithered.jpg",
7373
0, 0, false, false))
7474
{
@@ -87,7 +87,7 @@ void setup()
8787
http.getStream().setTimeout(1);
8888

8989
http.begin("https://raw.githubusercontent.com/SolderedElectronics/Inkplate-Arduino-library/"
90-
"Inkplate2-DrawImage3Color-And-Examples/examples/Inkplate2/Advanced/WEB_WiFi/"
90+
"master/examples/Inkplate2/Advanced/WEB_WiFi/"
9191
"Inkplate2_Show_Pictures_From_Web/car.bmp");
9292

9393
// Check response code.
@@ -129,7 +129,7 @@ void setup()
129129
// true will flip all colors on the image, making black white and white black. fourth parameter will dither the
130130
// image.
131131
if (!display.drawImage("https://raw.githubusercontent.com/SolderedElectronics/Inkplate-Arduino-library/"
132-
"Inkplate2-DrawImage3Color-And-Examples/examples/Inkplate2/Advanced/WEB_WiFi/"
132+
"master/examples/Inkplate2/Advanced/WEB_WiFi/"
133133
"Inkplate2_Show_Pictures_From_Web/mountain.png",
134134
0, 0, true, false))
135135
{

examples/Inkplate4TEMPERA/Advanced/WEB_WiFi/Inkplate4TEMPERA_Show_JPG_With_HTTPClient/Inkplate4TEMPERA_Show_JPG_With_HTTPClient.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ char *ssid = ""; // Your WiFi SSID
3232
char *pass = ""; // Your WiFi password
3333

3434
// Add the URL of the image you want to show on Inkplate
35-
String url = "https://raw.githubusercontent.com/SolderedElectronics/Inkplate-Arduino-library/dev/examples/"
35+
String url = "https://raw.githubusercontent.com/SolderedElectronics/Inkplate-Arduino-library/master/examples/"
3636
"Inkplate4TEMPERA/Advanced/WEB_WiFi/Inkplate4TEMPERA_Show_JPG_With_HTTPClient/image.jpg";
3737

3838
/***********************************************/

examples/Inkplate5/Advanced/WEB_WiFi/Inkplate5_Show_JPG_With_HTTPClient/Inkplate5_Show_JPG_With_HTTPClient.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ char *ssid = ""; // Your WiFi SSID
3232
char *pass = ""; // Your WiFi password
3333

3434
// Add the URL of the image you want to show on Inkplate
35-
String url = "https://raw.githubusercontent.com/SolderedElectronics/Inkplate-Arduino-library/dev/examples/Inkplate5/Advanced/WEB_WiFi/Inkplate5_Show_JPG_With_HTTPClient/image.jpg";
35+
String url = "https://raw.githubusercontent.com/SolderedElectronics/Inkplate-Arduino-library/master/examples/Inkplate5/Advanced/WEB_WiFi/Inkplate5_Show_JPG_With_HTTPClient/image.jpg";
3636

3737
/***********************************************/
3838

examples/Inkplate5/Basic/Inkplate5_Black_And_White/Inkplate5_Black_And_White.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
*/
1616

1717
// Next 3 lines are a precaution, you can ignore those, and the example would also work without them
18+
/**
1819
#ifndef ARDUINO_INKPLATE5
1920
#error "Wrong board selection for this example, please select Soldered Inkplate5 in the boards menu."
2021
#endif
21-
22+
*/
2223
#include "Inkplate.h" // Include Inkplate library to the sketch
2324
#include "logo.h" // Include header file for Soldered logo. You can see it in next tab inside Arduino IDE
2425
Inkplate display(INKPLATE_1BIT); // Create object on Inkplate library and set library to work in monochorme mode
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
Inkplate5V2_Bluetooth_Peripheral_Mode example for Soldered Inkplate 5 V2
3+
For this example you will need a USB-C cable, Inkplate 5 and smartphone.
4+
Select "Soldered Inkplate5 V2" from Tools -> Board menu.
5+
Don't have "Soldered Inkplate5 V2" option? Follow our tutorial and add it:
6+
https://soldered.com/learn/add-inkplate-6-board-definition-to-arduino-ide/
7+
8+
This example shows how to use Inkplate as a peripheral device over Bluetooth.
9+
More about peripheral mode: https://inkplate.readthedocs.io/en/latest/peripheral-mode.html
10+
11+
Upload this example to the Inkplate and connect your phone to it via Bluetooth.
12+
First, you have to pair the Inkplate with your phone in Bluetooth settings in your phone, then go to the
13+
Serial Bluetooth Terminal app and you can find the Inkplate in the device list. You can use another similar app.
14+
If Bluetooth starts successfully, you can send commands from your phone. Don't forget you need to send #L(1)* after
15+
each command to show it on the display (equal to display->display()).
16+
17+
Want to learn more about Inkplate? Visit www.inkplate.io
18+
Looking to get support? Write on our forums: https://forum.soldered.com/
19+
15 April 2024 by Soldered
20+
*/
21+
22+
// Next 3 lines are a precaution, you can ignore those, and the example would also work without them
23+
#ifndef ARDUINO_INKPLATE5V2
24+
#error "Wrong board selection for this example, please select Soldered Inkplate5 V2 in the boards menu."
25+
#endif
26+
27+
// Include Inkplate and BluetoothSerial library to the sketch
28+
#include "BluetoothSerial.h"
29+
#include "Inkplate.h"
30+
31+
// Include peripheral functions
32+
#include "Peripheral.h"
33+
34+
// Create an object on Inkplate library and also set library into 1-bit mode (BW)
35+
Inkplate display(INKPLATE_1BIT);
36+
37+
// Create SerialBT object for Bluetooth communication
38+
BluetoothSerial SerialBT;
39+
40+
// Size of buffer for receiving commands
41+
#define BUFFER_SIZE 1000
42+
43+
// Temporary buffer to send to Peripheral mode code
44+
char commandBuffer[BUFFER_SIZE + 1];
45+
46+
void setup()
47+
{
48+
// Init serial communication
49+
Serial.begin(115200);
50+
51+
// Init Inkplate library (you should call this function ONLY ONCE)
52+
display.begin();
53+
54+
// Init BT communication
55+
if (!SerialBT.begin("Inkplate5V2"))
56+
{
57+
Serial.println("An error occurred initializing Bluetooth");
58+
}
59+
else
60+
{
61+
Serial.println("The device started, now you can pair it with Bluetooth and send commands!");
62+
}
63+
}
64+
65+
void loop()
66+
{
67+
// When Bluetooth available save it and pass to Peripheral.h code
68+
while (SerialBT.available())
69+
{
70+
for (int i = 0; i < (BUFFER_SIZE - 1); i++)
71+
{
72+
commandBuffer[i] = commandBuffer[i + 1];
73+
}
74+
commandBuffer[BUFFER_SIZE - 1] = SerialBT.read();
75+
}
76+
77+
// Function in peripheral.h
78+
run(commandBuffer, BUFFER_SIZE, &display, &SerialBT);
79+
80+
// Wait a bit
81+
delay(50);
82+
}

0 commit comments

Comments
 (0)