adafruit / Adafruit_TouchScreen

Arduino library for 4-wire resistive touchscreens
http://www.adafruit.com/index.php?main_page=product_info&cPath=35&products_id=333
Other
276 stars 212 forks source link

getPoint() should return return unique value for invalid samples. #19

Open MerwinPaterwin opened 4 years ago

MerwinPaterwin commented 4 years ago

getPoint() returns a point with a pressure (TSPoint.z) of 0 if the A/D samples are not consistent. This is ambiguous, as a pressure of 0 means that there is no touch which is invariably not the case. I suggest that if the samples are inconsistent, a pressure of -1 be returned, signifying an invalid result. Please change line #169 of TouchScreen.cpp to z=-1;

Thanks.....