
mbed cz.1 ppo
Dependencies: LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI
Keyboard_Ts.cpp
- Committer:
- wkierepka
- Date:
- 2020-06-08
- Revision:
- 2:3a2602b8d89b
- Parent:
- 0:5a62c1cece88
File content as of revision 2:3a2602b8d89b:
#include "Keyboard_Ts.h" TS_DISCO_F429ZI ts; KeyboardTs :: KeyboardTs(unsigned char ucColumn) { ucColumnPosition = ucColumn; ts.Init(240, 320);} enum KeyboardState KeyboardTs :: eRead() { TS_StateTypeDef TS_State; ts.GetState(&TS_State); if ((TS_State.TouchDetected)&& (TS_State.X > ucColumnPosition*80 )&&(TS_State.X <(ucColumnPosition +1 )*80)) { if((TS_State.Y<80)) { return BUTTON_0; } else if ((80< TS_State.Y) && (TS_State.Y<160) ) { return BUTTON_1; } else if ((160< TS_State.Y) && (TS_State.Y<240) ) { return BUTTON_2; } else if ( (240< TS_State.Y)&& (TS_State.Y <320) ) { return BUTTON_3; } else { return RELASED; } } }