Open professorwade opened 1 year ago
I came to the exact same conclusion for the ESP32-S2 wich have an ADC of 13 bits. If you chage the 6 instances of the number 1023 with the #bits^2 (8191 in my case) it should work.
probably best to just set the adc resolution in the examples before use - wanna try that? https://www.arduino.cc/reference/en/language/functions/zero-due-mkr-family/analogreadresolution/
The problem with analogreadresolution() is that is work only with the: Zero, Due & MKR Family, not the ESP32-S2
I just filed a pull-request to solve that problem https://github.com/adafruit/Adafruit_TouchScreen/pull/43
Question: I noticed a number of 1024 and 1023 in the TouchScreen library and wonder if it is related to an assumption of a 10 bit A/D (i.e. Arduino 8-bit)? I am using the library with a SAMD51 part (Grand Central) and notice that the values tend to be much higher on the pressure.
https://github.com/adafruit/Adafruit_TouchScreen/blob/28e6e744982825d679f543b70480d31e457363b3/TouchScreen.cpp#L155