seed

Dependencies:   SPI_TFT_ILI9341

Fork of SeeedStudioTFTv2 by Components

Files at this revision

API Documentation at this revision

Comitter:
Ganstrich
Date:
Thu Apr 28 19:28:01 2016 +0000
Parent:
14:304b55ac904b
Commit message:
Versi 1

Changed in this revision

SeeedStudioTFTv2.cpp Show annotated file Show diff for this revision Revisions of this file
SeeedStudioTFTv2.h Show annotated file Show diff for this revision Revisions of this file
diff -r 304b55ac904b -r 23288c15e11d SeeedStudioTFTv2.cpp
--- a/SeeedStudioTFTv2.cpp	Mon Apr 18 06:59:46 2016 +0000
+++ b/SeeedStudioTFTv2.cpp	Thu Apr 28 19:28:01 2016 +0000
@@ -28,10 +28,10 @@
     _ym = ym;
     // default touch calibration
     // orientation  //      0      1      2      3
-    x_off =  16605 ;  //  17252  16605 108755 108000
-    y_off =  105819 ;  //  22330 105819  97167  22000
-    pp_tx =   289;  //    378    289   -390   -291
-    pp_ty =    -355;  //    261   -355   -239    356
+    x_off =  116670 ;  //  17252  16605 108755 108000
+    y_off =  29042 ;  //  22330 105819  97167  22000
+    pp_tx =   -291;  //    378    289   -390   -291
+    pp_ty =    306;  //    261   -355   -239    356
 }
 
 int SeeedStudioTFTv2::readTouch(PinName p, PinName m, PinName a, PinName i)
@@ -167,7 +167,7 @@
         /*nothing*/;
     cls();
     
-    Ecrire_Calibration(x_off, y_off, pp_tx, pp_ty);
+   Ecrire_Calibration(x_off, y_off, pp_tx, pp_ty);
 }
 
 point SeeedStudioTFTv2::toPixel(point p)
@@ -192,7 +192,7 @@
     return touch == YES;
 }
 
-void SeeedStudioTFTv2::Ecrire_Calibration(unsigned short x_off, unsigned short y_off, unsigned short pp_tx, unsigned short pp_ty)
+void SeeedStudioTFTv2::Ecrire_Calibration(signed long x_off, signed long y_off, signed long pp_tx, signed long pp_ty)
 {
     FILE* fichier = fopen("/local/calib.txt", "w");
     
@@ -203,10 +203,11 @@
 
 void SeeedStudioTFTv2::Lire_Calibration(void)
 {
+   
     FILE* fichier = fopen("/local/calib.txt", "r");
-
+    
     fscanf(fichier,"%d %d %d %d", &x_off, &y_off, &pp_tx, &pp_ty);
-    
+                
     fclose(fichier);
      
 }
diff -r 304b55ac904b -r 23288c15e11d SeeedStudioTFTv2.h
--- a/SeeedStudioTFTv2.h	Mon Apr 18 06:59:46 2016 +0000
+++ b/SeeedStudioTFTv2.h	Thu Apr 28 19:28:01 2016 +0000
@@ -64,7 +64,7 @@
     
     /* Ecrit les paramètres de calibrage dans un fichier à la racine du LPC*/
     
-    void Ecrire_Calibration(unsigned short x_off, unsigned short y_off, unsigned short pp_tx, unsigned short pp_ty);
+    void Ecrire_Calibration(signed long x_off, signed long y_off, signed long pp_tx, signed long pp_ty);
     
     /*Lit les paramètres de calibrage*/
     
@@ -77,8 +77,8 @@
     typedef enum { YES, MAYBE, NO } TOUCH;
     TOUCH getTouch(point& p);
     int readTouch(PinName p, PinName m, PinName a, PinName i);
-    int x_off,y_off;
-    int pp_tx,pp_ty;
+    signed long x_off,y_off;
+    signed long pp_tx,pp_ty;
     
 protected:
     PinName _xm;