TFT

Dependencies:   mbed TFT_fonts SPI_TFT_ILI9341

TFT-01.cpp

Committer:
zhguowen
Date:
2020-09-11
Revision:
0:b253876e3647

File content as of revision 0:b253876e3647:

#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");
}