Dependencies: 4DGL Rectangle mbed Screens
Diff: main.cpp
- Revision:
- 0:55bfec6d748f
- Child:
- 1:b8c8bc16d6a1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue May 03 13:36:16 2011 +0000 @@ -0,0 +1,57 @@ + #include "mbed.h" +// #include "TFT_4DGL.h" +// #include "Rectangle.h" +#include "Screens.h" + +Screens * ecran; +TFT_4DGL tmp(p13,p14,p15); + int main() { + ecran = new Screens(&tmp); // serial tx, serial rx, reset pin; + char s[500]; + int x = 0, y = 0, status, xc = 0, yc = 0; + + tmp.background_color(0xFFFFFF); // Fond blancs +//ecran->rectangle(0, 100 , 0, 100, BLACK); + // ecran.rectangle(190, 0, 190,SIZE_Y, 0x000000); // cadre noir + //ecran.pen_size(WIREFRAME); + //ecran.set_font(FONT_8X8); + // Rectangle un_rectangle(ecran,0,0,10,10,0x0000); + //ecran.text_mode(TRANSPARENT); + //ecran.text_button("F", UP, 200, 10, 0x0000FF, FONT_8X8, 0xFFFFFF, 2, 2); + + // les's play with touch screen now + + /* ecran.set_font(FONT_12X16); + ecran.pen_size(SOLID); + ecran.text_mode(OPAQUE); + ecran.display_control(TOUCH_CTRL, ENABLE); + ecran.set_touch(0, 0, 239, 319); + ecran.wait_touch(50000);*/ + + while (1) { + /* ecran.locate(0,18); + status = ecran.touch_status(); + printf(s, "Status:%d",status); + ecran.puts(s); + ecran.get_touch(&x, &y); + ecran.locate(0,19); + sprintf(s, "X:%03d Y:%03d",x, y); + ecran.puts(s); + switch (status) { + case 1 : + xc = x; + yc = y; + ecran.circle(xc,yc,20,WHITE); + break; + case 2 : + ecran.circle(xc,yc,20,BLACK); + break; + case 3 : + ecran.circle(xc,yc,20,BLACK); + xc = x; + yc = y; + ecran.circle(xc,yc,20,WHITE); + break; + }*/ + } + } \ No newline at end of file