Hello everyone,
I'm a relatively new to Arduino programming. I have used them in the past to build robots, but now I'm doing something brand new to me. That being working with touch screens. luckily I have gotten my ESP32 based board working well with the screen, with a custom gui that's almost done. So now I need to save the calibration form the screen. The TFT_eSPI library has a touch calibration function built in. It only outputs to a uint16_t array with 6 slots (0 - 5). So to make it work It looks something like this:
#include <TFT_eSPI.h>
#include <SPI.h>
TFT_eSPI tft = TFT_eSPI();
uint16_t calData[6];
void setup() {
tft.calibrateTouch( calData, TFT_MAGENTA, TFT_BLACK, 15); // Runs a test that has you touch the corners of the screen
tft.setTouch(calData); // setTouch actually implements the data form calibrateTouch
}
void loop() {
//Rest of the code
}
From what I have been reading EPROMM only accepts values for 0 - 255 (8 bit). The calibration data ranges from 0 to like 4800. I don't think converting such a large range into a small range is good idea because I lose so much precision, but I'm also not 100% sure of that.
TLDR; What is the best way and/or easiest way to store user inputted uint_16_t with a large range, so its not lost on power off?
Additional info (as if you need it after that long post):
The screen is 240 x 320, it also has a SD card slot. Board chip is the ESP32-WROOM32 and the board is called the NodeMCU Esp-32s.
Thanks in advanced, anything helps!