Skip to content

Commit 9da154b

Browse files
authored
Merge pull request #248 from SolderedElectronics/Inkplate5V2_dev
Inkplate5 v2 dev
2 parents 0a7c413 + 23ba633 commit 9da154b

File tree

369 files changed

+91766
-1
lines changed

Some content is hidden

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

369 files changed

+91766
-1
lines changed

.github/workflows/compile.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ jobs:
77
strategy:
88
matrix:
99
include:
10+
- board:
11+
fqbn: Inkplate_Boards:esp32:Inkplate5
12+
additional-sketch-paths: |
13+
- examples/Inkplate5
14+
- board:
15+
fqbn: Inkplate_Boards:esp32:Inkplate5V2
16+
additional-sketch-paths: |
17+
- examples/Inkplate5V2
1018
- board:
1119
fqbn: Inkplate_Boards:esp32:Inkplate6
1220
additional-sketch-paths: |

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)