Dependencies:   4DGL Rectangle mbed Screens

main.cpp

Committer:
projetremote
Date:
2011-05-03
Revision:
1:b8c8bc16d6a1
Parent:
0:55bfec6d748f

File content as of revision 1:b8c8bc16d6a1:

 #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;
 
    ecran->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;
        }*/
    }
 }