This application makes it possible to calibrate the touch screen. Note that the calibration data is not persistently saved. Either do the calibration on every startup or modify the default values in DmTouchCalibration.

Dependencies:   DmTftLibrary mbed

Revision:
4:6bcad4fe23d6
Parent:
0:aba2ac5dd09d
--- a/main.cpp	Mon Sep 01 10:46:17 2014 +0000
+++ b/main.cpp	Thu Jan 22 01:10:00 2015 +0000
@@ -21,6 +21,7 @@
 #include "DmTftIli9325.h"
 #include "DmTftIli9341.h"
 #include "DmTftSsd2119.h"
+#include "DmTftRa8875.h"
 #include "DmTouch.h"
 #include "DmTouchCalibration.h"
 
@@ -61,14 +62,17 @@
 
 //DmTftIli9325 tft;  /* DM_TFT28_103 and DM_TFT24_104 */
 //DmTftIli9341 tft;  /* DM_TFT28_105 */
-DmTftSsd2119 tft;   /* DM_TFT35_107 */
+//DmTftSsd2119 tft;   /* DM_TFT35_107 */
+DmTftRa8875  tft;  /* DM_TFT43_108 and DM_TFT50_111 */  
 
 //DmTouch touch(DmTouch::DM_TFT28_103, DmTouch::Software); /* For LPC4088 QuickStart Board */
 //DmTouch touch(DmTouch::DM_TFT28_103);
 //DmTouch touch(DmTouch::DM_TFT24_104, DmTouch::Software); /* For LPC4088 QuickStart Board */
 //DmTouch touch(DmTouch::DM_TFT24_104);
 //DmTouch touch(DmTouch::DM_TFT28_105);
-DmTouch touch(DmTouch::DM_TFT35_107);
+//DmTouch touch(DmTouch::DM_TFT35_107);
+//DmTouch touch(DmTouch::DM_TFT43_108);  // For DmTftRa8875 driver, The panel resolution should be config in DmTftRa8875::init() function on the DmTftRa8875.cpp file.
+DmTouch touch(DmTouch::DM_TFT50_111);
 
 DmTouchCalibration calibration = DmTouchCalibration(&tft, &touch); 
 
@@ -96,7 +100,7 @@
   if (!calibrated) {
     tft.drawString(5, 5, "Press and hold on cross");
     tft.drawString(5, 25, "until it turns green. ");
-      
+
     Point displayRefPoint[5];
     Point touchRefPoint[5];
     if (calibration.getTouchReferencePoints(displayRefPoint, touchRefPoint, tft.width(), tft.height())) {