micro paint to show the touchscreen and tft handling
Dependencies: mbed Touch_tft TFT_fonts_old
Revision 2:9d80fd43a008, committed 2011-09-04
- Comitter:
- dreschpe
- Date:
- Sun Sep 04 21:49:22 2011 +0000
- Parent:
- 1:d03155bfc252
- Commit message:
- fix char printing because of change of SPI_TFT.locate() function to pixel coordinates
Changed in this revision
diff -r d03155bfc252 -r 9d80fd43a008 SPI_TFT.lib --- a/SPI_TFT.lib Thu Jul 14 22:49:04 2011 +0000 +++ b/SPI_TFT.lib Sun Sep 04 21:49:22 2011 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/dreschpe/code/SPI_TFT/#e1e45f8a7664 +http://mbed.org/users/dreschpe/code/SPI_TFT/#4781bb8eed45
diff -r d03155bfc252 -r 9d80fd43a008 TFT_fonts.lib --- a/TFT_fonts.lib Thu Jul 14 22:49:04 2011 +0000 +++ b/TFT_fonts.lib Sun Sep 04 21:49:22 2011 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/dreschpe/code/TFT_fonts/#d4d8df7e30d8 +http://mbed.org/users/dreschpe/code/TFT_fonts/#31ce4466ecdf
diff -r d03155bfc252 -r 9d80fd43a008 Touch_tft.lib --- a/Touch_tft.lib Thu Jul 14 22:49:04 2011 +0000 +++ b/Touch_tft.lib Sun Sep 04 21:49:22 2011 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/dreschpe/code/Touch_tft/#1745fdf054b5 +http://mbed.org/users/dreschpe/code/Touch_tft/#ef7972c29c0e
diff -r d03155bfc252 -r 9d80fd43a008 main.cpp --- a/main.cpp Thu Jul 14 22:49:04 2011 +0000 +++ b/main.cpp Sun Sep 04 21:49:22 2011 +0000 @@ -8,7 +8,7 @@ // the TFT is connected to SPI pin 5-7 // the touch is connected to 19,20,16,17 -touch_tft tt(p19,p20,p16,p17,p5, p6, p7, p8, p15,"TFT"); // x+,x-,y+,y-,mosi, miso, sclk, cs, reset +touch_tft tt(p19,p20,p16,p17,p11, p12, p13, p14, p15,"TFT"); // x+,x-,y+,y-,mosi, miso, sclk, cs, reset int main() { @@ -26,7 +26,7 @@ tt.calibrate(); // calibrate the touch tt.locate(0,0); printf(" x = "); - tt.locate(0,1); + tt.locate(0,12); printf(" y = "); tt.line(0,25,319,25,White); // the color chosing fields @@ -44,6 +44,7 @@ p = tt.get_touch(); if (tt.is_touched(p)) { // touch + p = tt.to_pixel(p); // convert to pixel pos if (p.y < 26) { // a button field if (p.x > 80 && p.x < 100) { // White @@ -79,13 +80,12 @@ if (p.x > 300) { tt.fillrect(0,26,319,239,Black); } - - + } else { tt.fillcircle(p.x,p.y,brush,color); - tt.locate(3,0); + tt.locate(36,0); printf("%3d",p.x); - tt.locate(3,1); + tt.locate(36,12); printf("%3d",p.y); } }