Utilisation de la librairie modifiée pour afficher un Hello world sur l'écran de l'arduino esplora

Dependencies:   ST7735_TFT mbed

Fork of SPI18TFT by Jonne Valola

This program is a little hello world for the arduino esplora's screen.

/!\ do't forget to include !!My!! ST7735 llibary /!\ link: http://mbed.org/users/alex_asi_elec/code/ST7735_TFT/

main.cpp

Committer:
alex_asi_elec
Date:
2013-12-06
Revision:
1:a7ccea14bb0d
Parent:
0:309c546f048d

File content as of revision 1:a7ccea14bb0d:

 #include "stdio.h"
 #include "stdlib.h"
 #include "math.h"
 #include "mbed.h"
 #include "ST7735_TFT.h"
 #include "string"
 #include "Arial12x12.h"
 #include "Arial24x23.h"
 #include "Arial28x28.h"

 #define SCREEN_WIDTH 160
 #define SCREEN_HEIGHT 128
 


 
  
 // the TFT is connected to SPI pin 5-7, CS is p8, RS is p11, reset is p15 
 ST7735_TFT TFT(p11, p12, p13, p14, p16, p17,"TFT"); // mosi, miso, sclk, cs, rs, reset
 
 Serial pc(USBTX, USBRX); // tx, rx
 Timer t;

extern unsigned char p1[];  // the mbed logo
 
 int main() {
    TFT.set_orientation(3);
   
    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();
    TFT.set_font((unsigned char*) Arial24x23);  // select the font
   
    TFT.locate(0,10);
    TFT.set_font((unsigned char*) Arial12x12);  // select the font
    printf(" Hello world!");
    TFT.circle(70, 70, 30, Red);
    TFT.fillrect(20, 100, 100, 130, Blue);
  }