Sensovery Company / Mbed 2 deprecated Telecommande_prologue

Dependencies:   4DGL Rectangle mbed Screens

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001  #include "mbed.h"
00002 // #include "TFT_4DGL.h"
00003 // #include "Rectangle.h"
00004 #include "Screens.h"
00005 
00006 Screens *  ecran;
00007 TFT_4DGL tmp(p13,p14,p15);
00008  int main() {
00009      ecran = new Screens(&tmp); // serial tx, serial rx, reset pin;
00010      char s[500];
00011      int x = 0, y = 0, status, xc = 0, yc = 0;
00012  
00013     ecran->background_color(0xFFFFFF); // Fond blancs
00014 //ecran->rectangle(0, 100 , 0, 100, BLACK);
00015     // ecran.rectangle(190, 0, 190,SIZE_Y, 0x000000); // cadre noir
00016      //ecran.pen_size(WIREFRAME);
00017      //ecran.set_font(FONT_8X8);
00018     // Rectangle un_rectangle(ecran,0,0,10,10,0x0000);
00019      //ecran.text_mode(TRANSPARENT);
00020      //ecran.text_button("F", UP, 200, 10, 0x0000FF, FONT_8X8, 0xFFFFFF, 2, 2);
00021  
00022      // les's play with touch screen now
00023  
00024     /* ecran.set_font(FONT_12X16);
00025      ecran.pen_size(SOLID);
00026      ecran.text_mode(OPAQUE);
00027      ecran.display_control(TOUCH_CTRL, ENABLE);
00028      ecran.set_touch(0, 0, 239, 319);
00029      ecran.wait_touch(50000);*/
00030  
00031      while (1) {
00032         /* ecran.locate(0,18);
00033          status = ecran.touch_status();
00034          printf(s, "Status:%d",status);
00035          ecran.puts(s);
00036          ecran.get_touch(&x, &y);
00037          ecran.locate(0,19);
00038          sprintf(s, "X:%03d Y:%03d",x, y);
00039          ecran.puts(s);
00040          switch (status) {
00041              case 1 :
00042                  xc = x;
00043                  yc = y;
00044                  ecran.circle(xc,yc,20,WHITE);
00045                  break;
00046              case 2 :
00047                 ecran.circle(xc,yc,20,BLACK);
00048                  break;
00049              case 3 :
00050                 ecran.circle(xc,yc,20,BLACK);
00051                 xc = x;
00052                 yc = y;
00053                  ecran.circle(xc,yc,20,WHITE);
00054                 break;
00055         }*/
00056     }
00057  }