I am building a device with an ESP32 that incluldes a TFT Touch Screen which is intended to be built in series for multiple users.
I want to make sure that the first time the devide is energized, the calibration is performed for the TFT display, but the following times it is not (unless the user seems it is necessary).
How can I do that?
How can I know if it was already calibrated?
Hi.
You can save the coeficients used for the calibration on variables on the ESP32 flash memory using Preferences.h.
When it loads a program, first it can check if there are any calibration coefficients saved. If not, it should run the calibration sketch. If there are already coeficients saved, it means the calibration was already performed.
To learn more about preferences: https://randomnerdtutorials.com/esp32-save-data-permanently-preferences/
One of our readers created a sketch for the calibration that saves the coeficients on variables using Preferences.h.
His sketch was compatible with LVGL version 9.1. You can check his examples here: https://github.com/CF20852/ESP32-2432S028-Touchscreen-Calibration
I hope this helps.
Regards,
Sara