A controller for a 5 wire resistive touch screen

Revision:
4:ab2e56595286
Parent:
3:710534c5a240
Child:
5:519187025bb4
--- a/TouchController.cpp	Fri Sep 16 02:50:22 2016 +0000
+++ b/TouchController.cpp	Thu Sep 22 22:38:32 2016 +0200
@@ -1,6 +1,6 @@
 #include "TouchController.hpp"
 
-TouchController::TouchController(PinName ur, PinName lr, PinName s, PinName ul, PinName ll, int num_of_samples) :
+TouchController::TouchController(PinName ur, PinName lr, PinName s, PinName ul, PinName ll, int num_of_samples, int settle) :
   _UR(ur),
   _LR(lr),
   _UL(ul),
@@ -21,7 +21,7 @@
   _S = s;
   n_samples = num_of_samples;
 
-  settle = 100;
+  _settle = settle;
 
   A = 1660.540541f;
   B = 20.5005005f;
@@ -129,3 +129,8 @@
 
  return ( measured_val/n_samples);
 }
+
+void TouchController::SetSettleTime(int settle)
+{
+  _settle = settle;
+}