Open lukasfischer83 opened 5 years ago
Good catch, thank goodness I found your post (and your simple solution) in time!
Now the Adafruit touchscreen works like a charm on my ESP32!
@lukasfischer83 @Ryan-obl Hey! I wonder what pins do you use on ESP32 for Xp, Xm, Yp and Ym? It doesn't seem to work for me.
This edit works, I would refrain from using inputonly pins for xxyy measurements. This led to unusable results in my tests.
@lukasfischer83 @Ryan-obl Hey! I wonder what pins do you use on ESP32 for Xp, Xm, Yp and Ym? It doesn't seem to work for me.
Hey @LeonidKokhnovich , I would use any pins that has any of the ESP32's ADCs on it, which naturally would depend on which board your ESP32 is on.
For instance, I'm using the ESP32 DevKitC v4, whose pinout can be found at: https://components101.com/microcontrollers/esp32-devkitc
Cheers, Ryan
Arduino board: ESP32 Hi, I just noticed a small bug on ESP32, which has 12bit ADC resolution. The driver works as expected if
analogReadResolution(10);
is called before usinggetPoint()
. Otherwhise, as expected, it does not ;). So maybe you could implement a check on the resolution and change the calculations (1023 is hardcoded in some lines) or simply right-shift the adc results by two if ESP32 is defined. Cheers, Lukas
This was so much helpful. I struggled with ESP32 touchscreen issue. The touchpoint values were strange. I thought some other circuits are interfering electric signals and so ESP32 is reading wrong values. But it was ADC resolution issue. I realized that after reading this. Thanks again!
I just filed a pull-request to solve that problem https://github.com/adafruit/Adafruit_TouchScreen/pull/43
Arduino board: ESP32 Hi, I just noticed a small bug on ESP32, which has 12bit ADC resolution. The driver works as expected if
analogReadResolution(10);
is called before usinggetPoint()
. Otherwhise, as expected, it does not ;). So maybe you could implement a check on the resolution and change the calculations (1023 is hardcoded in some lines) or simply right-shift the adc results by two if ESP32 is defined. Cheers, Lukas