Paint for the FRDM-KL25Z
Dependencies: mbed TFT_fonts SPI_TFT_ILI9341
touch.h
- Committer:
- ecowboy
- Date:
- 2019-01-07
- Revision:
- 0:42ec9a44bc24
- Child:
- 1:33506fcfdd95
File content as of revision 0:42ec9a44bc24:
#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);