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: LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI
Keyboard_Ts.cpp
00001 #include "Keyboard_Ts.h" 00002 #include "TS_DISCO_F429ZI.h" 00003 00004 TS_DISCO_F429ZI ts; 00005 00006 KeyboardTs::KeyboardTs(unsigned char ucColumnPosition){ 00007 ts.Init(240, 320); 00008 ucColumnIndex = ucColumnPosition; 00009 } 00010 00011 enum State KeyboardTs::eRead(void){ 00012 TS_StateTypeDef TS_State; 00013 ts.GetState(&TS_State); 00014 uint16_t x, y; 00015 x = TS_State.X; 00016 y = TS_State.Y; 00017 if(TS_State.TouchDetected){ 00018 if ((x > (ucColumnIndex*80)) && (x < ((ucColumnIndex+1)*80))){ 00019 if((y < 80) && (y > 0)){ 00020 return BUTTON_0; 00021 } 00022 else if((y > 80) && (y < 160)){ 00023 return BUTTON_1; 00024 } 00025 else if((y > 160) && (y < 240)){ 00026 return BUTTON_2; 00027 } 00028 else if(y > 240){ 00029 return BUTTON_3; 00030 } 00031 else { 00032 return RELASED; 00033 } 00034 } 00035 else { 00036 return RELASED; 00037 } 00038 } 00039 else{ 00040 return RELASED; 00041 } 00042 }
Generated on Tue Jul 12 2022 21:37:19 by
1.7.2