adafruit / Adafruit_HX8357_Library

Arduino library for HX8357
43 stars 37 forks source link

Incorrect Touchscreen Mapping Code in Example Files #43

Open allmysparetime opened 11 months ago

allmysparetime commented 11 months ago

Was using the Adafruit TFT FeatherWing 3.5" 480x320 Touchscreen (Version 1) with an Adafruit HUZZAH32 ESP32 Feather Board and found a mapping error in two example files.

For: examples/touchpaint_featherwing/touchpaint_featherwing.ino Line 156 p.x = map(p.x, min_x, max_x, 0, tft.width()); should be p.x = map(p.x, min_x, max_x, tft.width(), 0);

For: examples/gfxbuttontest_featherwing/gfxbuttontest_featherwing.ino Line 266 int py = map(p.x, max_x, min_x, 0, tft.height()); should be int py = map(p.x, min_x, max_x, 0, tft.height());

For both example files, the correct file for the Version 1 screen had been selected: // If using the rev 1 with STMPE resistive touch screen controller uncomment this line: #include <Adafruit_STMPE610.h> // If using the rev 2 with TSC2007, uncomment this line: //#include <Adafruit_TSC2007.h>