Skip to content

Commit 131b71f

Browse files
saving progress
1 parent 5a7d79e commit 131b71f

File tree

31 files changed

+3298
-2256
lines changed

31 files changed

+3298
-2256
lines changed

examples/Inkplate10/Diagnostics/Inkplate10_Factory_Programming_VCOM/Inkplate10_Factory_Programming_VCOM.ino

Lines changed: 173 additions & 343 deletions
Large diffs are not rendered by default.

examples/Inkplate10/Diagnostics/Inkplate10_Factory_Programming_VCOM/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const char *WSSID = {"Soldered Electronics"};
88
const char *WPASS = {"dasduino"};
99

1010
// Change this to your used slave device
11-
const uint8_t easyCDeviceAddress = 0x30;
11+
const uint8_t easyCDeviceAddress = 0x76;
1212

1313
// Test all peripherals
1414
void testPeripheral()
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
/**
2+
**************************************************
3+
* @file Inkplate10_Waveform_Select.ino
4+
* @brief Selects and (optionally) burns an Inkplate 10 waveform via Serial.
5+
*
6+
* @details This example lets you preview Inkplate 10 EPD waveforms (1–5) and
7+
* choose the best-looking one for your panel. Type a number (1–5)
8+
* in Serial Monitor to preview that waveform on an 8-step grayscale
9+
* gradient. Type "test" to show a demo image. Type "ok" to burn the
10+
* currently selected waveform into ESP32 EEPROM using:
11+
* display.setWaveform(waveformNumber, burnToEEPROM)
12+
*
13+
* Requirements:
14+
* - Board: Soldered Inkplate 10 / Inkplate 10 V2
15+
* - Hardware: Inkplate 10, USB cable
16+
* - Extra: image.h (demo image) for "test" command
17+
*
18+
* Configuration:
19+
* - Boards Manager -> Inkplate Boards -> Soldered Inkplate10
20+
* - Serial Monitor: 115200 baud, Newline (LF)
21+
*
22+
* How to use:
23+
* 1) Upload the sketch to Inkplate 10.
24+
* 2) Open Serial Monitor at 115200 baud and set line ending to Newline (LF).
25+
* 3) Send a number 1–5 to preview waveform on gradient.
26+
* 4) Send "test" to show demo image.
27+
* 5) Send "ok" to burn the currently selected waveform to EEPROM.
28+
*
29+
* Notes:
30+
* - EEPROM stores waveform data (limited endurance). Only burn when needed.
31+
* - Display mode: 3-bit grayscale (INKPLATE_3BIT).
32+
*
33+
* Docs: https://docs.soldered.com/inkplate
34+
* Support: https://forum.soldered.com/
35+
*
36+
* @author Soldered
37+
* @date 2026-03-05
38+
* @license GNU GPL V3
39+
**************************************************/
40+
#if !defined(ARDUINO_INKPLATE10) && !defined(ARDUINO_INKPLATE10V2)
41+
#error "Select Inkplate10 board"
42+
#endif
43+
44+
#include <Inkplate.h>
45+
#include "image.h"
46+
47+
Inkplate display(INKPLATE_3BIT);
48+
49+
static int currentWaveform = 1;
50+
51+
static void showGradient(int selected)
52+
{
53+
display.clearDisplay();
54+
55+
int w = display.width() / 8;
56+
int h = display.height() - 100;
57+
58+
display.fillRect(0, 725, 1200, 100, 7);
59+
60+
display.setTextSize(4);
61+
display.setTextColor(0);
62+
display.setCursor(10, 743);
63+
display.print("Waveform select: ");
64+
65+
display.setCursor(432, 743);
66+
for (int i = 1; i <= 5; i++)
67+
{
68+
display.print(i);
69+
display.print(' ');
70+
}
71+
72+
display.drawRect((selected * 6 * 4 * 2) + 432 - 3, 740, (6 * 4) + 2, (8 * 4) + 2, 0);
73+
74+
for (int i = 0; i < 8; i++)
75+
display.fillRect(i * w, 0, w, h, i);
76+
77+
display.setTextSize(3);
78+
display.setCursor(10, 792);
79+
display.print("Send 1-5, \"ok\" to burn, \"test\" for image");
80+
81+
display.display();
82+
}
83+
84+
static void showTestImage()
85+
{
86+
display.clearDisplay();
87+
display.image.drawBitmap3Bit(0, 0, demo_image, demo_image_w, demo_image_h);
88+
display.display();
89+
}
90+
91+
static int readCommand()
92+
{
93+
if (!Serial.available())
94+
return 0;
95+
96+
String s = Serial.readStringUntil('\n');
97+
s.trim();
98+
s.toLowerCase();
99+
100+
if (s == "ok")
101+
return 255;
102+
103+
if (s == "test")
104+
return 254;
105+
106+
int n = s.toInt();
107+
if (n >= 1 && n <= 5)
108+
return n;
109+
110+
return 0;
111+
}
112+
113+
void setup()
114+
{
115+
Serial.begin(115200);
116+
display.begin();
117+
118+
Serial.println("Waveform select: send 1-5 to preview, \"test\" for image, \"ok\" to burn.");
119+
120+
display.setWaveform(currentWaveform, false);
121+
showGradient(currentWaveform);
122+
123+
while (true)
124+
{
125+
int cmd = readCommand();
126+
127+
if (cmd >= 1 && cmd <= 5)
128+
{
129+
currentWaveform = cmd;
130+
display.setWaveform(currentWaveform, false);
131+
showGradient(currentWaveform);
132+
}
133+
else if (cmd == 254)
134+
{
135+
showTestImage();
136+
}
137+
else if (cmd == 255)
138+
{
139+
display.setWaveform(currentWaveform, true);
140+
141+
display.clearDisplay();
142+
display.setCursor(10, 100);
143+
display.print("Waveform ");
144+
display.print(currentWaveform);
145+
display.print(" programmed!");
146+
display.display();
147+
148+
Serial.print("Waveform ");
149+
Serial.print(currentWaveform);
150+
Serial.println(" burned to EEPROM.");
151+
break;
152+
}
153+
}
154+
}
155+
156+
void loop()
157+
{
158+
}

examples/Inkplate10/Diagnostics/Inkplate10_Set_Waveform/image.h

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

examples/Inkplate2/Diagnostics/Inkplate2_Factory_Programming/test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
#include "Wire.h"
33

44
// Change this to your WiFi
5-
const char *WSSID = {""};
6-
const char *WPASS = {""};
5+
const char *WSSID = {"Soldered Electronics"};
6+
const char *WPASS = {"dasduino"};
77

88
// Change this to your used slave device
9-
const uint8_t easyCDeviceAddress = 0x30;
9+
const uint8_t easyCDeviceAddress = 0x76;
1010

1111
// Test all peripherals
1212
void testPeripheral()

examples/Inkplate2/Diagnostics/Inkplate2_Peripheral_Mode/Inkplate2_Peripheral_Mode.ino

Lines changed: 68 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,71 @@
1-
/*
2-
Inkplate2_Peripheral_Mode sketch for Soldered Inkplate 2 (IP2).
3-
For this example you will need only a USB-C cable and Inkplate 2.
4-
Select "Soldered Inkplate 2" from Tools -> Board menu.
5-
Don’t have "Soldered Inkplate 2" option? Follow our tutorial and add it:
6-
https://soldered.com/learn/add-inkplate-2-board-definition-to-arduino-ide/
7-
8-
Using this sketch, you don’t have to program and control the e-paper display using Arduino code.
9-
Instead, you can send UART commands. This gives you the flexibility to use Inkplate 2 on any platform!
10-
11-
Because it uses UART, it’s a bit slower and not recommended to send a large number of
12-
drawPixel commands to render images. Instead, store bitmaps or pictures on an SD card
13-
and load them directly from there.
14-
If any functionality is missing, you can modify this code and make your own version.
15-
Every Inkplate 2 comes with this Peripheral Mode preloaded from the factory.
16-
17-
Learn more about Peripheral Mode:
18-
https://inkplate.readthedocs.io/en/latest/peripheral-mode.html
19-
20-
UART settings are: 115200 baud, standard parity, ending with "\n\r" (Both NL & CR)
21-
You can send commands via the USB port or by directly connecting to the ESP32 TX and RX pins.
22-
23-
Want to learn more about Inkplate? Visit:
24-
https://soldered.com/documentation/inkplate/
25-
26-
23 October 2025 by Soldered
27-
*/
1+
/**
2+
**************************************************
3+
* @file Inkplate2_Peripheral_Mode.ino
4+
* @brief Enables UART-based Peripheral Mode control for Inkplate 2.
5+
*
6+
* @details This example enables Peripheral Mode on the Inkplate 2,
7+
* allowing external devices to control the e-paper display
8+
* through a UART command interface instead of Arduino code.
9+
*
10+
* In this mode, drawing commands, display updates, and other
11+
* operations are sent as text commands over the serial
12+
* connection. This allows Inkplate 2 to function as a
13+
* display peripheral for systems such as PCs, Raspberry Pi,
14+
* microcontrollers, or embedded Linux devices.
15+
*
16+
* The sketch initializes the Inkplate display and a
17+
* PeripheralMode command parser which listens for incoming
18+
* UART commands and executes them in real time.
19+
*
20+
* This firmware is typically preloaded on Inkplate 2 devices
21+
* from the factory and provides a flexible way to control the
22+
* display without compiling Arduino sketches.
23+
*
24+
* Because UART communication is relatively slow, sending large
25+
* numbers of pixel-level commands (such as drawPixel loops) is
26+
* inefficient. For displaying images, it is recommended to
27+
* store bitmap files on the SD card and load them directly.
28+
*
29+
* Requirements:
30+
* - Board: Soldered Inkplate 2
31+
* - Hardware: Inkplate 2, USB-C cable
32+
* - Extra: External controller device (optional)
33+
*
34+
* Configuration:
35+
* - Boards Manager -> Inkplate Boards -> Soldered Inkplate 2
36+
* - UART settings: 115200 baud, standard parity
37+
* - Line ending: "\n\r" (newline + carriage return)
38+
*
39+
* Don't have Inkplate Boards in Arduino Boards Manager?
40+
* See https://docs.soldered.com/inkplate/10/quick-start-guide/
41+
*
42+
* How to use:
43+
* 1) Upload the sketch to the Inkplate 2.
44+
* 2) Connect to the board using a serial terminal or external device.
45+
* 3) Configure UART to 115200 baud with line ending "\n\r".
46+
* 4) Send supported Peripheral Mode commands to control the display.
47+
* 5) The device responds with "READY" when initialization completes.
48+
*
49+
* Expected output:
50+
* - Serial: "READY" message when Peripheral Mode is initialized.
51+
* - Display: Updates according to received UART drawing commands.
52+
*
53+
* Notes:
54+
* - Peripheral Mode allows Inkplate to be controlled from any system
55+
* capable of UART communication.
56+
* - Sending large pixel-by-pixel commands is slow; prefer loading
57+
* images from SD storage when possible.
58+
* - This firmware acts as a command interpreter and runs continuously,
59+
* processing serial commands inside the main loop.
60+
*
61+
* Docs: https://docs.soldered.com/inkplate
62+
* https://inkplate.readthedocs.io/en/latest/peripheral-mode.html
63+
* Support: https://forum.soldered.com/
64+
*
65+
* @author Soldered
66+
* @date 2025-10-23
67+
* @license GNU GPL V3
68+
**************************************************/
2869

2970
// Include Inkplate library
3071
#include "Inkplate.h"

examples/Inkplate2/Diagnostics/Inkplate2_Peripheral_Mode/InkplatePeripheralMode.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ void PeripheralMode::parseCommand(int _command, int _repeat, int _payloadSize, c
904904
_path[_argSize / 2] = '\0';
905905

906906
// Try to open an image from microSD card. Send reponse back if the opening was successful or not.
907-
if (_display->drawImage((const char*)_path, atol(_xPos), atol(_yPos), atol(_dither) & 1, atol(_invert) &1))
907+
if (_display->image.draw((const char*)_path, atol(_xPos), atol(_yPos), atol(_dither) & 1, atol(_invert) &1))
908908
{
909909
sendResponse(CMD_DRAW_IMAGE, strlen((char*)_okResponseString), (char*)_okResponseString);
910910
}
@@ -920,7 +920,7 @@ void PeripheralMode::parseCommand(int _command, int _repeat, int _payloadSize, c
920920
strncpy(_pathNew, _path, _argSize);
921921
_pathNew[_argSize]='\0';
922922
// Try to open an image from microSD card. Send reponse back if the opening was successful or not.
923-
if (_display->drawImage((const char*)_pathNew, atol(_xPos), atol(_yPos), atol(_dither) & 1, atol(_invert) &1))
923+
if (_display->image.draw((const char*)_pathNew, atol(_xPos), atol(_yPos), atol(_dither) & 1, atol(_invert) &1))
924924
{
925925
sendResponse(CMD_DRAW_IMAGE, strlen((char*)_okResponseString), (char*)_okResponseString);
926926
}
@@ -961,7 +961,7 @@ void PeripheralMode::parseCommand(int _command, int _repeat, int _payloadSize, c
961961
hexAsciiToAscii(_hexData, _argSize);
962962

963963
// Display the image from the buffer.
964-
_display->drawImage((const uint8_t*)_hexData, atol(_xPos), atol(_yPos), atol(_w), atol(_h));
964+
_display->image.draw((const uint8_t*)_hexData, atol(_xPos), atol(_yPos), atol(_w), atol(_h));
965965
break;
966966
}
967967
case CMD_CLEAR_DISPLAY:

examples/Inkplate4TEMPERA/Diagnostics/Inkplate4TEMPERA_Factory_Programming_VCOM/Inkplate4TEMPERA_Factory_Programming_VCOM.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void setup()
168168
display.print(vcomVoltage);
169169
display.partialUpdate();
170170

171-
if (display.setVcom(vcomVoltage, EEPROMaddress))
171+
if (display.setVCOM(vcomVoltage))
172172
{
173173
Serial.println("\nVCOM EEPROM PROGRAMMING OK\n");
174174
break;
@@ -185,7 +185,6 @@ void setup()
185185
{
186186
Serial.println("VCOM already set!");
187187
display.einkOn();
188-
vcomVoltage = display.getVcomVoltage();
189188
}
190189

191190
memset(commandBuffer, 0, BUFFER_SIZE);

examples/Inkplate4TEMPERA/Diagnostics/Inkplate4TEMPERA_Factory_Programming_VCOM/test.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
const char sdCardTestStringLength = 100;
44
const char *testString = {"This is some test string..."};
55

6-
const char *WSSID = {""};
7-
const char *WPASS = {""};
6+
const char *WSSID = {"Soldered Electronics"};
7+
const char *WPASS = {"dasduino"};
88

99
// Change this to your used slave device
10-
const uint8_t easyCDeviceAddress = 0x30;
10+
const uint8_t easyCDeviceAddress = 0x76;
1111

1212
const int TOUCHSCREEN_TIMEOUT = 30;
1313
const int GESTURE_TIMEOUT = 30;
@@ -544,6 +544,7 @@ int checkTouch(uint8_t _tsTimeout)
544544

545545
int checkBME(float *temp, float *hum, float *pres)
546546
{
547+
display.wakePeripheral(INKPLATE_BME688);
547548
// Init BME
548549
int beginResult = display.bme688.begin();
549550

examples/Inkplate5/Diagnostics/Inkplate5_Factory_Programming_VCOM/Inkplate5_Factory_Programming_VCOM.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void setup()
111111
display.print(vcomVoltage);
112112
display.partialUpdate();
113113

114-
if (display.setVcom(vcomVoltage, EEPROMaddress))
114+
if (display.setVCOM(vcomVoltage))
115115
{
116116
Serial.println("\nVCOM EEPROM PROGRAMMING OK\n");
117117
break;
@@ -133,7 +133,6 @@ void setup()
133133
// can damage your display if used incorrectly!
134134
// *****************************************************
135135
display.einkOn();
136-
vcomVoltage = display.getVcomVoltage();
137136
}
138137

139138
// Clear buffer for peripheral commands

0 commit comments

Comments
 (0)