Ce programme a été adapté du programme Canary prévu pour 2 afficheur.

Dependencies:   SPI_TFTx2_w9341 TFT_fonts mbed

main.cpp

Committer:
schnf30
Date:
2016-03-15
Revision:
0:3e86ee2d8c14

File content as of revision 0:3e86ee2d8c14:

#include "stdio.h"
#include "mbed.h"
#include "SPI_TFTx2_ILI9341.h"
#include "string"
#include "Arial12x12.h"
#include "Arial24x23.h"
 
SPI_TFTx2_ILI9341 TFT(p5, p6, p7, p8, p9, p10,"TFT"); // mosi, miso, sclk, cs, reset, dc

int main() {
    TFT.claim(stdout);      // send stdout to the TFT display
    //TFT.claim(stderr);      // send stderr to the TFT display
 
    TFT.background(Black);    // set background to black
    TFT.foreground(White);    // set chars to white
    TFT.cls();                // clear the screen
    TFT.set_font((unsigned char*) Arial12x12);  // select the font
 
    TFT.set_orientation(1);
    printf("  Hello Mbed 0");
    TFT.set_font((unsigned char*) Arial24x23);  // select font 2
    TFT.locate(48,115);
    TFT.printf("I'm Corentin oups");
    TFT.fillrect(0,160,320,170,Blue);    
    TFT.fillrect(0,170,320,180,Red);  
     TFT.fillrect(0,180,320,190,White);     
    }