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
KeyboardTs.cpp
- Committer:
- thepaueu
- Date:
- 2020-05-14
- Revision:
- 0:db2c7dc10f89
File content as of revision 0:db2c7dc10f89:
#include "KeyboardTs.h"
KeyboardTs::KeyboardTs(unsigned char ucStartCol){
ucColumn = ucStartCol;
}
enum BUTTON KeyboardTs::eRead(void){
int x,y;
TS_StateTypeDef TS_State;
ts.GetState(&TS_State);
if (TS_State.TouchDetected){
x = TS_State.X;
y = TS_State.Y;
}
if(TS_State.TouchDetected && x>= ucColumn*80 && x <= 80*(ucColumn+1) ){
if(y>=0 && y<=80)
return BUTTON_0;
else if(y>=81 && y<=160)
return BUTTON_1;
else if(y>=161 && y<=240)
return BUTTON_2;
else if(y>=241 && y<=320)
return BUTTON_3;
}
else
return NONE;
}