My first trial of using UniGraphic library.
Dependencies: MMA8451Q SPI_STMPE610 UniGraphic mbed
Diff: main.cpp
- Revision:
- 1:6cd56ddffb40
- Parent:
- 0:be311b6a294c
- Child:
- 2:ed52c8915226
--- a/main.cpp Tue Feb 17 13:22:06 2015 +0000
+++ b/main.cpp Wed Feb 18 00:55:40 2015 +0000
@@ -35,35 +35,40 @@
void screen1(void) // Welcome Screen
{
backlight = 0 ;
+ TFT.BusEnable(true) ;
TFT.background(White) ;
TFT.cls() ;
wait(0.1) ;
TFT.set_font((unsigned char*) Arial24x23);
TFT.foreground(Red) ;
- TFT.locate(80, 40) ;
+ TFT.locate(80, 30) ;
TFT.printf("MBED") ;
TFT.foreground(Blue);
- TFT.locate(60, 80) ;
+ TFT.locate(60, 60) ;
TFT.printf("2.8\"TFT") ;
- TFT.locate(40, 120) ;
+ TFT.locate(40, 90) ;
TFT.printf("with touch") ;
+ TFT.foreground(Green) ;
+ TFT.locate(10, 130) ;
+ TFT.printf("UniGraphic Ver.") ;
TFT.foreground(Black);
TFT.set_font((unsigned char*) Arial12x12);
TFT.foreground(Blue) ;
- TFT.locate(10, 180) ;
+ TFT.locate(20, 180) ;
TFT.printf("This program is running on") ;
- TFT.locate(10, 200) ;
+ TFT.locate(20, 200) ;
TFT.printf("freescale FRDM-KL25Z with") ;
- TFT.locate(10, 220) ;
+ TFT.locate(20, 220) ;
TFT.printf("a program developed on mbed") ;
TFT.foreground(Green) ;
- TFT.locate(10, 260) ;
+ TFT.locate(20, 260) ;
TFT.printf("To advance demo page, touch") ;
- TFT.locate(10, 280) ;
+ TFT.locate(20, 280) ;
TFT.printf("and hold right side of screen") ;
- TFT.locate(10, 300) ;
+ TFT.locate(20, 300) ;
TFT.printf("until the next screen starts") ;
+ TFT.BusEnable(false) ;
backlight = 1 ;
}
@@ -72,7 +77,8 @@
//Draw some graphics
int i, x[2], y[2] ;
backlight = 0 ;
-
+ TFT.BusEnable(true) ;
+
TFT.background(Black);
TFT.foreground(White);
TFT.cls() ;
@@ -116,6 +122,8 @@
TFT.printf("simple graphics drawing") ;
TFT.locate(20, 290) ;
TFT.printf("capability is provided") ;
+
+ TFT.BusEnable(false) ;
backlight = 1 ;
}
@@ -146,6 +154,7 @@
unsigned short paneH = 81 ;
backlight = 0 ;
+ TFT.BusEnable(true) ;
TFT.background(Black) ;
TFT.foreground(White) ;
// TFT.cls() ;
@@ -199,6 +208,7 @@
pt = t ;
wait(0.01) ;
}
+ TFT.BusEnable(false) ;
}
void incPage(void)
GraphicsDisplay