Skip to content

Commit 7382cb0

Browse files
committed
adding diagnostics
1 parent a541dcc commit 7382cb0

File tree

4 files changed

+352
-0
lines changed

4 files changed

+352
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/**
2+
**************************************************
3+
*
4+
* @file BurnInClean.ino
5+
* @brief This example will try to remove heavy burn-in visible on the panel.
6+
* Set number of refresh / clear cycles and upload the program.
7+
*
8+
* For info on how to quickly get started with Inkplate 5 V2 visit
9+
* https://soldered.com/documentation/inkplate/5/overview/
10+
*
11+
* @authors Soldered
12+
* @date November 2025
13+
***************************************************/
14+
15+
// Next 3 lines are a precaution, you can ignore those, and the example would also work without them
16+
#ifndef ARDUINO_INKPLATE5V2
17+
#error "Wrong board selection for this example, please select Soldered Inkplate 5 V2"
18+
#endif
19+
20+
// Include the Inkplate LVGL Library
21+
#include <Inkplate-LVGL.h>
22+
23+
// Create an instance of Inkplate object and set it to work in monochrome mode
24+
Inkplate inkplate(INKPLATE_1BIT);
25+
26+
// Number of clear cycles
27+
#define CLEAR_CYCLES 20
28+
29+
// Delay between clear cycles (in milliseconds)
30+
#define CYCLES_DELAY 5000
31+
32+
void setup()
33+
{
34+
inkplate.begin(); // Init library (you should call this function ONLY ONCE)
35+
inkplate.clearDisplay(); // Clear any data that may have been in (software) frame buffer
36+
37+
inkplate.einkOn(); // Turn on epaper display
38+
39+
int cycles = CLEAR_CYCLES;
40+
41+
// Clean it by writing clear sequence to the panel
42+
while (cycles)
43+
{
44+
inkplate.clean(1, 15);
45+
inkplate.clean(2, 1);
46+
inkplate.clean(0, 5);
47+
inkplate.clean(2, 1);
48+
inkplate.clean(1, 15);
49+
inkplate.clean(2, 1);
50+
inkplate.clean(0, 5);
51+
inkplate.clean(2, 1);
52+
53+
delay(CYCLES_DELAY);
54+
cycles--;
55+
}
56+
57+
/* Display text when finished */
58+
lv_obj_t *label = lv_label_create(lv_screen_active());
59+
lv_label_set_text(label, "Clearing Done!");
60+
lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0x000000), LV_PART_MAIN);
61+
lv_obj_set_style_text_font(label, &lv_font_montserrat_28, 0);
62+
lv_obj_align(label, LV_ALIGN_CENTER, 0, 10);
63+
64+
// Tick the LVGL timer by 50
65+
lv_tick_inc(50);
66+
67+
// Handle the new label and write it into the framebuffer
68+
lv_timer_handler();
69+
70+
// Display the created label onto the screen
71+
inkplate.display();
72+
}
73+
74+
void loop()
75+
{
76+
// Empty loop
77+
}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/**
2+
**************************************************
3+
*
4+
* @file RTCCalibration.ino
5+
* @brief Example showing how to Calibrate the RTC on Inkplate 5 V2
6+
* to be more precise and accurate.
7+
* Uses LVGL in grayscale (L8) mode.
8+
*
9+
* For info on how to quickly get started with Inkplate 5 V2 visit
10+
* https://soldered.com/documentation/inkplate/5/overview/
11+
*
12+
* @authors Soldered
13+
* @date November 2025
14+
***************************************************/
15+
#include <Inkplate-LVGL.h>
16+
17+
Inkplate inkplate(INKPLATE_1BIT); // LVGL-enabled Inkplate instance (Inkplate 5 V2, grayscale / L8)
18+
19+
#define REFRESH_DELAY 1000 // Read RTC every second
20+
unsigned long time1 = 0;
21+
22+
// RTC start values
23+
uint8_t hours = 0;
24+
uint8_t minutes = 0;
25+
uint8_t seconds = 0;
26+
27+
// Pointers to LVGL labels
28+
lv_obj_t *mainLabel = nullptr;
29+
30+
// Update LVGL label and refresh display
31+
void setLabel(const char *text)
32+
{
33+
lv_label_set_text(mainLabel, text);
34+
lv_obj_align(mainLabel, LV_ALIGN_CENTER, 0, 0);
35+
36+
// Let LVGL process timers and internal state,
37+
// then push a full grayscale (L8) frame to the Inkplate
38+
lv_tick_inc(50);
39+
lv_timer_handler();
40+
inkplate.display();
41+
}
42+
43+
void setup()
44+
{
45+
Serial.begin(115200);
46+
47+
// Initialize Inkplate in LVGL FULL render mode
48+
// (Inkplate 5 V2, grayscale / L8 handled by the Inkplate-LVGL library config)
49+
inkplate.begin(LV_DISP_RENDER_MODE_FULL);
50+
51+
// White background (L8 grayscale: 0xFFFFFF is treated as white)
52+
lv_obj_set_style_bg_color(lv_screen_active(),
53+
lv_color_hex(0xFFFFFF),
54+
LV_PART_MAIN);
55+
56+
// Create primary LVGL label
57+
mainLabel = lv_label_create(lv_screen_active());
58+
lv_obj_set_style_text_font(mainLabel, &lv_font_montserrat_28, 0);
59+
lv_obj_set_style_text_color(mainLabel, lv_color_hex(0x000000), LV_PART_MAIN);
60+
61+
// Initial message
62+
setLabel("RTC calibration\n\n"
63+
"Open Serial Monitor\n"
64+
"at 115200 baud.");
65+
66+
// Configure wake-up button input
67+
// On Inkplate 5 V2 the “WAKE” button is connected to GPIO 36 (same as many examples)
68+
pinMode(GPIO_NUM_36, INPUT);
69+
70+
// Set internal RTC capacitor (12.5 pF recommended)
71+
inkplate.rtc.setInternalCapacitor(RTC_12_5PF);
72+
73+
// Set RTC frequency offset (example values; adjust to your calibration)
74+
inkplate.rtc.setClockOffset(1, -63);
75+
76+
Serial.println("Press the wake-up button to start RTC");
77+
78+
setLabel("RTC calibration\n\n"
79+
"Press WAKE button to start.");
80+
81+
// Wait for button press
82+
while (digitalRead(GPIO_NUM_36) == HIGH)
83+
{
84+
delay(10);
85+
}
86+
87+
// Initialize RTC time
88+
inkplate.rtc.setTime(hours, minutes, seconds);
89+
90+
setLabel("RTC started.\n"
91+
"Tracking time...\n"
92+
"See Serial Monitor at 115200 baud.");
93+
}
94+
95+
void loop()
96+
{
97+
// Print new time every second
98+
if (millis() - time1 > REFRESH_DELAY)
99+
{
100+
inkplate.rtc.getRtcData();
101+
102+
seconds = inkplate.rtc.getSecond();
103+
minutes = inkplate.rtc.getMinute();
104+
hours = inkplate.rtc.getHour();
105+
106+
Serial.printf("%02d:%02d:%02d\n", hours, minutes, seconds);
107+
108+
time1 = millis();
109+
}
110+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/**
2+
**************************************************
3+
*
4+
* @file BurnInClean.ino
5+
* @brief This example will try to remove heavy burn-in visible on the panel.
6+
* Set number of refresh / clear cycles and upload the program.
7+
*
8+
* For info on how to quickly get started with Inkplate 6 visit
9+
* https://soldered.com/documentation/inkplate/6/overview/
10+
*
11+
* @authors Soldered
12+
* @date November 2025
13+
***************************************************/
14+
15+
// Next 3 lines are a precaution, you can ignore those, and the example would also work without them
16+
#ifndef ARDUINO_INKPLATE6
17+
#error "Wrong board selection for this example, please select Soldered Inkplate 6"
18+
#endif
19+
20+
// Include the Inkplate LVGL Library
21+
#include <Inkplate-LVGL.h>
22+
23+
// Create an instance of Inkplate object and set it to work in monochrome mode
24+
Inkplate inkplate(INKPLATE_1BIT);
25+
26+
// Number of clear cycles
27+
#define CLEAR_CYCLES 20
28+
29+
// Delay between clear cycles (in milliseconds)
30+
#define CYCLES_DELAY 5000
31+
32+
void setup()
33+
{
34+
inkplate.begin(); // Init library (you should call this function ONLY ONCE)
35+
inkplate.clearDisplay(); // Clear any data that may have been in (software) frame buffer
36+
37+
inkplate.einkOn(); // Turn on epaper display
38+
39+
int cycles = CLEAR_CYCLES;
40+
41+
// Clean it by writing clear sequence to the panel
42+
while (cycles)
43+
{
44+
inkplate.clean(1, 15);
45+
inkplate.clean(2, 1);
46+
inkplate.clean(0, 5);
47+
inkplate.clean(2, 1);
48+
inkplate.clean(1, 15);
49+
inkplate.clean(2, 1);
50+
inkplate.clean(0, 5);
51+
inkplate.clean(2, 1);
52+
53+
delay(CYCLES_DELAY);
54+
cycles--;
55+
}
56+
57+
/* Display text when finished */
58+
lv_obj_t *label = lv_label_create(lv_screen_active());
59+
lv_label_set_text(label, "Clearing Done!");
60+
lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0x000000), LV_PART_MAIN);
61+
lv_obj_set_style_text_font(label, &lv_font_montserrat_28, 0);
62+
lv_obj_align(label, LV_ALIGN_CENTER, 0, 10);
63+
64+
// Tick the LVGL timer by 50
65+
lv_tick_inc(50);
66+
67+
// Handle the new label and write it into the framebuffer
68+
lv_timer_handler();
69+
70+
// Display the created label onto the screen
71+
inkplate.display();
72+
}
73+
74+
void loop()
75+
{
76+
// Empty loop
77+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/**
2+
**************************************************
3+
*
4+
* @file RTCCalibration.ino
5+
* @brief Example showing how to calibrate the RTC on Inkplate 6.
6+
* Uses LVGL in grayscale (L8) mode.
7+
*
8+
* For info on how to quickly get started with Inkplate 6 visit:
9+
* https://soldered.com/documentation/inkplate/6/overview/
10+
*
11+
***************************************************/
12+
#include <Inkplate-LVGL.h>
13+
14+
Inkplate inkplate(INKPLATE_1BIT); // LVGL-enabled Inkplate instance
15+
16+
#define REFRESH_DELAY 1000 // Read RTC every second
17+
unsigned long time1 = 0;
18+
19+
// RTC start values
20+
uint8_t hours = 0;
21+
uint8_t minutes = 0;
22+
uint8_t seconds = 0;
23+
24+
// Pointers to LVGL labels
25+
lv_obj_t *mainLabel = nullptr;
26+
27+
void setLabel(const char *text)
28+
{
29+
lv_label_set_text(mainLabel, text);
30+
lv_obj_align(mainLabel, LV_ALIGN_CENTER, 0, 0);
31+
32+
lv_tick_inc(50);
33+
lv_timer_handler();
34+
inkplate.display();
35+
}
36+
37+
void setup()
38+
{
39+
Serial.begin(115200);
40+
41+
// Initialize Inkplate in LVGL FULL render mode
42+
inkplate.begin(LV_DISP_RENDER_MODE_FULL);
43+
44+
// White background
45+
lv_obj_set_style_bg_color(lv_screen_active(),
46+
lv_color_hex(0xFFFFFF),
47+
LV_PART_MAIN);
48+
49+
// Create primary LVGL label
50+
mainLabel = lv_label_create(lv_screen_active());
51+
lv_obj_set_style_text_font(mainLabel, &lv_font_montserrat_28, 0);
52+
lv_obj_set_style_text_color(mainLabel, lv_color_hex(0x000000), LV_PART_MAIN);
53+
54+
setLabel("RTC calibration\n\nOpen Serial Monitor\n115200 baud.");
55+
56+
// Wake button on Inkplate 6 = GPIO 36
57+
pinMode(GPIO_NUM_36, INPUT);
58+
59+
inkplate.rtc.setInternalCapacitor(RTC_12_5PF);
60+
inkplate.rtc.setClockOffset(1, -63);
61+
62+
Serial.println("Press Wake button to start RTC");
63+
64+
setLabel("RTC calibration\n\nPress Wake button to start.");
65+
66+
while (digitalRead(GPIO_NUM_36) == HIGH)
67+
delay(10);
68+
69+
inkplate.rtc.setTime(hours, minutes, seconds);
70+
71+
setLabel("RTC started.\nTracking time...\nCheck Serial Monitor.");
72+
}
73+
74+
void loop()
75+
{
76+
if (millis() - time1 > REFRESH_DELAY)
77+
{
78+
inkplate.rtc.getRtcData();
79+
80+
seconds = inkplate.rtc.getSecond();
81+
minutes = inkplate.rtc.getMinute();
82+
hours = inkplate.rtc.getHour();
83+
84+
Serial.printf("%02d:%02d:%02d\n", hours, minutes, seconds);
85+
86+
time1 = millis();
87+
}
88+
}

0 commit comments

Comments
 (0)