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_F429ZI LCD_DISCO_F429ZI TS_DISCO_F429ZI mbed
Keyboard_Ts.cpp
00001 #include "TS_DISCO_F429ZI.h" 00002 #include "Keyboard_Ts.h" 00003 00004 TS_DISCO_F429ZI ts; 00005 TS_StateTypeDef TS_State; 00006 00007 unsigned char ucColumnChosen; 00008 00009 KeyboardTs::KeyboardTs(unsigned char ucSetColums){ 00010 ts.Init(240,320); 00011 ucColumnChosen = ucSetColums; 00012 } 00013 00014 enum KeyboardState KeyboardTs::eRead(void){ 00015 ts.GetState(&TS_State); 00016 if (TS_State.TouchDetected) { 00017 if (TS_State.Y >= 80 * ucColumnChosen && TS_State.Y <= 80 * (ucColumnChosen+1)) { 00018 if (TS_State.X <= 80) 00019 return LED_0; 00020 else if (TS_State.X >= 80 && TS_State.X <= 160) 00021 return LED_1; 00022 else if (TS_State.X>= 160 && TS_State.X <= 240) 00023 return LED_2; 00024 else if (TS_State.X >= 240 && TS_State.X <= 320) 00025 return LED_3; 00026 } 00027 } 00028 return RELEASED; 00029 }
Generated on Sat Jul 23 2022 10:37:40 by
1.7.2