a

Dependents:   2c

Committer:
Dom952
Date:
Sat Apr 23 17:44:02 2016 +0000
Revision:
0:8e2c3c55da79
a

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Dom952 0:8e2c3c55da79 1 #include "Keyboard_Ts.h"
Dom952 0:8e2c3c55da79 2
Dom952 0:8e2c3c55da79 3 KeyboardTs::KeyboardTs (unsigned char _ucColumn)
Dom952 0:8e2c3c55da79 4 {
Dom952 0:8e2c3c55da79 5 Column = _ucColumn;
Dom952 0:8e2c3c55da79 6 }
Dom952 0:8e2c3c55da79 7
Dom952 0:8e2c3c55da79 8 enum KeyboardTsState KeyboardTs::eRead( void )
Dom952 0:8e2c3c55da79 9 {
Dom952 0:8e2c3c55da79 10 ts.GetState(&TS_State);
Dom952 0:8e2c3c55da79 11 x = TS_State.X;
Dom952 0:8e2c3c55da79 12 y = TS_State.Y;
Dom952 0:8e2c3c55da79 13 if (TS_State.TouchDetected)
Dom952 0:8e2c3c55da79 14 {
Dom952 0:8e2c3c55da79 15 if ( ( x > Column*80 ) && ( x <= (Column+1)*80 ) && ( y > 0 ) && ( y < 80 ) )
Dom952 0:8e2c3c55da79 16 {
Dom952 0:8e2c3c55da79 17 return BUTTON_0;
Dom952 0:8e2c3c55da79 18 }
Dom952 0:8e2c3c55da79 19 else if ( ( x > Column*80 ) && ( x <= (Column+1)*80 ) && ( y >= 80 ) && ( y < 160 ) )
Dom952 0:8e2c3c55da79 20 {
Dom952 0:8e2c3c55da79 21 return BUTTON_1;
Dom952 0:8e2c3c55da79 22 }
Dom952 0:8e2c3c55da79 23 else if ( ( x > Column*80 ) && ( x <= (Column+1)*80 ) && ( y >= 160 ) && ( y < 240 ) )
Dom952 0:8e2c3c55da79 24 {
Dom952 0:8e2c3c55da79 25 return BUTTON_2;
Dom952 0:8e2c3c55da79 26 }
Dom952 0:8e2c3c55da79 27 else if ( ( x > Column*80 ) && ( x <= (Column+1)*80 ) && ( y >= 240 ) && ( y < 320 ) )
Dom952 0:8e2c3c55da79 28 {
Dom952 0:8e2c3c55da79 29 return BUTTON_3;
Dom952 0:8e2c3c55da79 30 }
Dom952 0:8e2c3c55da79 31 }
Dom952 0:8e2c3c55da79 32 return RELASED;
Dom952 0:8e2c3c55da79 33 }