Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BSP_DISCO_F746NG Graphics mbed TS_DISCO_F746NG
TouchScreen.cpp
00001 // 00002 // TouchScreen.cpp 00003 // 00004 00005 #include "TouchScreen.h" 00006 00007 //Serial pc(USBTX, USBRX); 00008 00009 TouchScreen::TouchScreen(Display* display) 00010 { 00011 _width = display != NULL ? display->DisplayWidth() - 1: 479; 00012 _height = display != NULL ? display->DisplayHeight() - 1: 271; 00013 } 00014 00015 00016 void TouchScreen::Init() 00017 { 00018 TS_DISCO_F746NG::Init(_width, _height); 00019 } 00020 00021 00022 pPoint TouchScreen::DetectTouch() 00023 { 00024 GetState(&tsState); 00025 // Debug message 00026 //pc.printf("."); 00027 00028 if(tsState.touchDetected > 0) { 00029 touchPoint.X = tsState.touchX[0]; 00030 touchPoint.Y = tsState.touchY[0]; 00031 00032 // Debug message 00033 //pc.printf("Touch detected at (%d, %d)\r\n", touchPoint.X, touchPoint.Y); 00034 00035 //ResetTouchData(&tsState); 00036 return &touchPoint; 00037 } 00038 00039 return NULL; 00040 }
Generated on Wed Jul 13 2022 08:01:03 by
1.7.2