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
272 stars 212 forks source link

Added support for ADCs with other than 10 bit #43

Open ScruffR opened 1 year ago

ScruffR commented 1 year ago

Added support for ADCs with other than 10 bir resolution, by adding a optional paramter adcBits to constructor. The constructor updates a member variable _adcMax to 2^adcBits-1. Subsequent calculations are now using this variable instead of constants 1023/1024 (which are only correct for 10bit ADCs).

The addition of the optional parameter legacy code will not be affected by the change.