![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ECE 4180 @ Georgia Tech
Dependencies: mbed mbed-rtos 4DGL-uLCD-SE MMA8452
main.cpp@0:cfcf73272647, 2011-02-24 (annotated)
- Committer:
- 4180_1
- Date:
- Thu Feb 24 15:15:39 2011 +0000
- Revision:
- 0:cfcf73272647
- Child:
- 1:38ef731c7bdf
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
4180_1 | 0:cfcf73272647 | 1 | // |
4180_1 | 0:cfcf73272647 | 2 | // TFT_4DGL is a class to drive 4D Systems TFT touch screens |
4180_1 | 0:cfcf73272647 | 3 | // |
4180_1 | 0:cfcf73272647 | 4 | // Copyright (C) <2010> Stephane ROCHON <stephane.rochon at free.fr> |
4180_1 | 0:cfcf73272647 | 5 | // |
4180_1 | 0:cfcf73272647 | 6 | // TFT_4DGL is free software: you can redistribute it and/or modify |
4180_1 | 0:cfcf73272647 | 7 | // it under the terms of the GNU General Public License as published by |
4180_1 | 0:cfcf73272647 | 8 | // the Free Software Foundation, either version 3 of the License, or |
4180_1 | 0:cfcf73272647 | 9 | // (at your option) any later version. |
4180_1 | 0:cfcf73272647 | 10 | // |
4180_1 | 0:cfcf73272647 | 11 | // TFT_4DGL is distributed in the hope that it will be useful, |
4180_1 | 0:cfcf73272647 | 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
4180_1 | 0:cfcf73272647 | 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4180_1 | 0:cfcf73272647 | 14 | // GNU General Public License for more details. |
4180_1 | 0:cfcf73272647 | 15 | // |
4180_1 | 0:cfcf73272647 | 16 | // You should have received a copy of the GNU General Public License |
4180_1 | 0:cfcf73272647 | 17 | // along with TFT_4DGL. If not, see <http://www.gnu.org/licenses/>. |
4180_1 | 0:cfcf73272647 | 18 | |
4180_1 | 0:cfcf73272647 | 19 | #include "mbed.h" |
4180_1 | 0:cfcf73272647 | 20 | #include "TFT_4DGL.h" |
4180_1 | 0:cfcf73272647 | 21 | |
4180_1 | 0:cfcf73272647 | 22 | TFT_4DGL ecran(p9,p10,p11); // serial tx, serial rx, reset pin; |
4180_1 | 0:cfcf73272647 | 23 | |
4180_1 | 0:cfcf73272647 | 24 | int main() { |
4180_1 | 0:cfcf73272647 | 25 | char s[500]; |
4180_1 | 0:cfcf73272647 | 26 | int x = 0, y = 0, status, xc = 0, yc = 0; |
4180_1 | 0:cfcf73272647 | 27 | |
4180_1 | 0:cfcf73272647 | 28 | |
4180_1 | 0:cfcf73272647 | 29 | ecran.baudrate(115200); |
4180_1 | 0:cfcf73272647 | 30 | // new code to set resolution to 640 by 480 |
4180_1 | 0:cfcf73272647 | 31 | // also changed max size_x and size_y in TFT_4DGL_graphics.h |
4180_1 | 0:cfcf73272647 | 32 | // Screen_res command is 12 decimal and not 12hex as listed in manual |
4180_1 | 0:cfcf73272647 | 33 | ecran.display_control(SCREEN_RES, char(1)); |
4180_1 | 0:cfcf73272647 | 34 | ecran.background_color(DGREY); |
4180_1 | 0:cfcf73272647 | 35 | ecran.circle(120, 160, 80, 0xFF00FF); |
4180_1 | 0:cfcf73272647 | 36 | ecran.triangle(120, 100, 40, 300, 200, 270, 0x0000FF); |
4180_1 | 0:cfcf73272647 | 37 | ecran.line(0, 0, 239, 319, 0xFF0000); |
4180_1 | 0:cfcf73272647 | 38 | ecran.rectangle(50, 50, 200, 90, 0x00FF00); |
4180_1 | 0:cfcf73272647 | 39 | ecran.ellipse(100, 250, 80, 30, 0xFFFF00); |
4180_1 | 0:cfcf73272647 | 40 | ecran.pixel(120, 160, BLACK); |
4180_1 | 0:cfcf73272647 | 41 | ecran.read_pixel(120, 170); |
4180_1 | 0:cfcf73272647 | 42 | ecran.screen_copy(50, 50, 200, 200, 100, 100); |
4180_1 | 0:cfcf73272647 | 43 | ecran.pen_size(WIREFRAME); |
4180_1 | 0:cfcf73272647 | 44 | ecran.circle(120, 160, 60, BLACK); |
4180_1 | 0:cfcf73272647 | 45 | ecran.set_font(FONT_8X8); |
4180_1 | 0:cfcf73272647 | 46 | ecran.text_mode(TRANSPARENT); |
4180_1 | 0:cfcf73272647 | 47 | ecran.text_char('B', 9, 8, BLACK); |
4180_1 | 0:cfcf73272647 | 48 | ecran.text_char('I',10, 8, BLACK); |
4180_1 | 0:cfcf73272647 | 49 | ecran.text_char('G',11, 8, BLACK); |
4180_1 | 0:cfcf73272647 | 50 | ecran.graphic_char('G', 120, 120, BLACK, 4, 4); |
4180_1 | 0:cfcf73272647 | 51 | ecran.text_string("This is a test of string", 2, 12, FONT_8X8, WHITE); |
4180_1 | 0:cfcf73272647 | 52 | ecran.graphic_string("This is a test of graphic string", 20, 200, FONT_8X8, WHITE, 2, 2); |
4180_1 | 0:cfcf73272647 | 53 | ecran.text_button("OK", UP, 40, 260, 0xFF0000, FONT_8X8, BLACK, 2, 2); |
4180_1 | 0:cfcf73272647 | 54 | // demo code deleted here for touch screen - no touch screen on uVGA II |
4180_1 | 0:cfcf73272647 | 55 | |
4180_1 | 0:cfcf73272647 | 56 | |
4180_1 | 0:cfcf73272647 | 57 | } |