-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathSeeedTouchScreen.h
39 lines (31 loc) · 964 Bytes
/
SeeedTouchScreen.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
SeeedTouchScreen.h - Library for 4-line resistance touch screen.
Modified by loovee Aug 12, 2012.
(c) ladyada / adafruit
Code under MIT License.
*/
#define __PRESSURE 10
#define __PRESURE __PRESSURE // Previous misspelled macro left for backwards compatibility
#if defined(PORT_IOBUS)
// On SAMD21, redefine digitalPinToPort() to use the slightly-faster
// PORT_IOBUS rather than PORT (not needed on SAMD51).
#undef digitalPinToPort
#define digitalPinToPort(P) (&(PORT_IOBUS->Group[g_APinDescription[P].ulPort]))
#endif // end PORT_IOBUS
class Point {
public:
int x, y, z;
public:
Point(void);
Point(int x, int y, int z);
bool operator==(Point);
bool operator!=(Point);
};
class TouchScreen {
private:
unsigned char _yp, _ym, _xm, _xp;
public:
TouchScreen(unsigned char xp, unsigned char yp, unsigned char xm, unsigned char ym);
bool isTouching(void);
Point getPoint();
};