seed
Fork of SeeedStudioTFTv2 by
Diff: SeeedStudioTFTv2.cpp
- Revision:
- 15:23288c15e11d
- Parent:
- 14:304b55ac904b
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); }