Paint for the FRDM-KL25Z
Dependencies: mbed TFT_fonts SPI_TFT_ILI9341
Diff: touch.cpp
- Revision:
- 3:1396bac4ae71
- Parent:
- 2:fe018965e46c
- Child:
- 4:87b40e5986e7
--- a/touch.cpp Tue Jan 08 06:56:55 2019 +0000 +++ b/touch.cpp Thu Jan 10 01:14:40 2019 +0000 @@ -1,12 +1,9 @@ #include "touch.h" #include "mbed.h" +#include "stdio.h" -TouchScreen::TouchScreen(PinName xp, PinName yp, PinName xm, PinName ym) { - PinName _yp = yp; - PinName _xm = xm; - PinName _ym = ym; - PinName _xp = xp; -} + +TouchScreen::TouchScreen(PinName xp, PinName yp, PinName xm, PinName ym) {} int TouchScreen::readTouch(PinName n, PinName m, PinName a, PinName i){ @@ -15,9 +12,12 @@ _n = 1; DigitalOut _m(m); _m = 0; + wait_ms(10); AnalogIn _a(a); + wait_ms(10); AnalogIn _i(i); wait_us(10); + _n = 0; return (int)_a.read_u16(); }