Paint for the FRDM-KL25Z
Dependencies: mbed TFT_fonts SPI_TFT_ILI9341
Diff: touch.h
- Revision:
- 0:42ec9a44bc24
- Child:
- 1:33506fcfdd95
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/touch.h Mon Jan 07 06:40:27 2019 +0000 @@ -0,0 +1,40 @@ +#include "mbed.h" + +#define RXPLATE 350 +#define Q 1024 //10 bit TSC Resolution +#define PRESSURE 10 + +/*class Point { + public: + int x, y, z; + + public: + Point(void); + Point(int x, int y, int z); + bool operator==(Point); + bool operator!=(Point); +};*/ + + +class Point { + private: + int x, y, z; + public: + Point() : x(0), y(0), z(0) {} + Point(int x, int y, int z) : x(x), y(y), z(z) {} +}; + + +class TouchScreen { + private: + PinName _yp, _ym, _xm, _xp; + + public: + TouchScreen(PinName xp, PinName yp, PinName xm, PinName ym); + int readTouch(PinName p, PinName m, PinName a, PinName i); + bool isTouching(void); + Point getPoint(Point p); + +}; + + int map(int value, int fromSource, int toSource, int fromTarget, int toTarget); \ No newline at end of file