jepjaee
Dependents: MIDI_Interface_ver_1
Fork of Touch_tft by
Revision 3:ef67f9068850, committed 2014-01-16
- Comitter:
- Vekotin
- Date:
- Thu Jan 16 07:47:42 2014 +0000
- Parent:
- 2:ef7972c29c0e
- Child:
- 4:cef5cdc775ea
- Commit message:
- touch kirjasto
Changed in this revision
touch_tft.cpp | Show annotated file Show diff for this revision Revisions of this file |
touch_tft.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/touch_tft.cpp Sun Sep 04 21:23:31 2011 +0000 +++ b/touch_tft.cpp Thu Jan 16 07:47:42 2014 +0000 @@ -19,13 +19,12 @@ #define threshold 0x2000 // threshold to detect pressed touch_tft::touch_tft(PinName xp, PinName xm, PinName yp, PinName ym, - PinName mosi, PinName miso, PinName sclk, PinName cs, PinName reset,const char* name): + PinName mosi, PinName miso, PinName sclk, PinName cs, PinName reset, PinName dc, const char* name): _xp(xp),_xm(xm),_yp(yp),_ym(ym),_ax(xp),_ay(yp), - SPI_TFT(mosi,miso,sclk,cs,reset,name) { + SPI_TFT_ILI9341(mosi,miso,sclk,cs,reset,dc,name) { xa = xp; - ya = yp; + ya = yp; } -} point touch_tft::get_touch() { unsigned short x1 = 0,x2 = 0, y1 = 0, y2 = 0; @@ -124,9 +123,9 @@ pos_y = pos_y * font[2]; locate(pos_x,pos_y); - printf("press cross"); + printf("paina ruksia"); locate(pos_x,pos_y + font[2]); - printf("to calibrate"); + printf("kalibroidaksesi"); for (i=0; i<5; i++) { do { p = get_touch(); @@ -146,9 +145,9 @@ line(width() -5, height() - 8,width() - 5,height() -1,White); // paint cross line(width() - 8,height() - 5,width() - 1,height() - 5,White); locate(pos_x,pos_y); - printf("press cross"); + printf("paina ruksia"); locate(pos_x,pos_y + font[2]); - printf("to calibrate"); + printf("kalibroidaksesi"); for (i=0; i<5; i++) { do { p = get_touch();
--- a/touch_tft.h Sun Sep 04 21:23:31 2011 +0000 +++ b/touch_tft.h Thu Jan 16 07:47:42 2014 +0000 @@ -15,7 +15,7 @@ #define MBED_TOUCH_H #include "mbed.h" -#include "SPI_TFT.h" +#include "SPI_TFT_ILI9341.h" struct point{ unsigned short x; @@ -58,7 +58,7 @@ * } * @endcode */ -class touch_tft : public SPI_TFT{ +class touch_tft : public SPI_TFT_ILI9341{ public: /** create a TFT with touch object connected to the pins: * @@ -71,7 +71,7 @@ * @param reset pin connected to RESET of display * based on my SPI_TFT lib */ - touch_tft(PinName xp, PinName xm, PinName yp, PinName ym,PinName mosi, PinName miso, PinName sclk, PinName cs, PinName reset,const char* name ="TFT"); + touch_tft(PinName xp, PinName xm, PinName yp, PinName ym,PinName mosi, PinName miso, PinName sclk, PinName cs, PinName reset, PinName dc, const char* name ="TFT"); /** calibrate the touch display *