TFT

Dependencies:   mbed TFT_fonts SPI_TFT_ILI9341

Revision:
0:b253876e3647
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TFT-01.cpp	Fri Sep 11 05:09:23 2020 +0000
@@ -0,0 +1,36 @@
+#include "stdio.h"
+#include "mbed.h"
+#include "SPI_TFT_ILI9341.h"
+#include "string.h"
+#include "Arial12x12.h"
+#include "Arial24x23.h"
+#include "Arial28x28.h"
+#include "font_big.h"
+
+
+extern unsigned char p1[];  //the mbed log
+DigitalOut LCD_LED(PB_2);
+
+SPI_TFT_ILI9341 TFT(PB_15, PB_14, PB_13, PC_10, PC_5, PC_8, "TFT");
+// mosi,miso,sclk,cs, reset, dc
+
+
+int main()
+{
+    int i;
+    LCD_LED=1;   //backlight on
+    TFT.claim(stdout);    //send stdout to the TFT display
+    TFT.claim(stderr);    //send stderr to the TFT display
+    
+        //simple text
+        
+    TFT.set_orientation(2);
+    TFT.foreground(White);
+    TFT.background(Black);
+    TFT.cls();
+    TFT.set_font((unsigned char*) Arial28x28);   //Arial24*23
+    TFT.locate(0,0);
+    TFT.printf("Test Text");
+}
+    
+    
\ No newline at end of file