Skip to content

Commit 131f6ed

Browse files
Update files related calibration.
1 parent a87f60f commit 131f6ed

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

README.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,28 @@ MLX90640.ino
124124
- `USE_PREFERENCES`
125125
- Step5: Resolution
126126

127-
### Dual-Core Timing Diagram
127+
### Dual-Core / Multitask Timing Diagram
128128
![Timing Diagram](images/TimingDiagram.png)
129129

130+
## Touch Screen Calibration
131+
132+
The “Calibration Screen” will appear when you run the sketch for the first time after compile & uploading,
133+
or when you select to run calibration from the menu.
134+
135+
<details>
136+
<summary>Calibration Screen</summary>
137+
138+
![Calibration Screen](images/TouchCalibration.jpg)
139+
</details>
140+
141+
If `USE_PREFERENCES` is set to `true`, you can save the calibration results to flash, but when it's set to `false`,
142+
you need to open the serial monitor before running the calibration and embed the displayed data into `touch.hpp`
143+
after calibration is completed.
144+
130145
## Related Project
131146
- [MLX90640Viewer](https://github.com/embedded-kiddie/MLX90640Viewer)
132-
The MLX90640Viewer is a tool that applies heatmaps and visualizes the output of the Melexis MLX90640 32x24 IR array, which is stored as continuous raw data in a file.
147+
The MLX90640Viewer is a tool that applies heatmaps and visualizes the output of the Melexis MLX90640 32x24 IR array,
148+
which is stored as continuous raw data in a file.
133149

134150
- [MLX90640 for Arduino UNO R4][23]
135151

images/TouchCalibration.jpg

43.4 KB
Loading

touch.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ void touch_calibrate(TouchConfig_t *config) {
248248
extern TFT_eSPI tft;
249249
sp.calibrateTouch(config->cal, &tft, TFT_WHITE, TFT_BLACK);
250250

251-
printf("\n// XPT2046\n");
251+
printf("\n// XPT2046_Touchscreen\n");
252252
printf(".cal = { ");
253253
for (int i = 0; i < 5; ++i) {
254254
printf("%d", config->cal[i]);

widgets.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -1495,6 +1495,9 @@ static void onCalibrationAdjust(const Widget_t *widget, const Touch_t &touch) {
14951495
static void onCalibrationSave(const Widget_t *widget, const Touch_t &touch) {
14961496
DBG_FUNC(printf("%s\n", __func__));
14971497

1498+
// Only when using flash is true
1499+
enable_save &= USE_PREFERENCES;
1500+
14981501
if (touch.event == EVENT_INIT) {
14991502
DrawButton(widget, enable_save);
15001503
}

0 commit comments

Comments
 (0)