Dependencies: mbed TouchScreen_kbv_mbed MCUFRIEND_kbv_R299 GLUE_STUFF_kbv ADA_GFX_kbv_R1107
Diff: TFT_exemplo_2.cpp
- Revision:
- 4:ac87a86055ab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TFT_exemplo_2.cpp Tue May 25 15:01:56 2021 +0000 @@ -0,0 +1,69 @@ +// *******************************Henrique************************************// +// Programa Teste 1 - Criando Formas Geométricas +// +// ************** Display TFT- ILI9341 Retângulo*************************** \\ + + +//************************ Biblioteca *****************************************// +#include "mbed.h" +#include "Arduino.h" +#include <MCUFRIEND_kbv.h> +MCUFRIEND_kbv tft; + +//****************************************************************************// + +//***********************Orientação Display**********************************// + + +uint8_t Orientation = 1; + +//****************************************************************************// + + + +//***********************Tabela de Cores**************************************// +#define BLACK 0x0000 +#define BLUE 0x001F +#define RED 0xF800 +#define GREEN 0x07E0 +#define CYAN 0x07FF +#define MAGENTA 0xF81F +#define YELLOW 0xFFE0 +#define WHITE 0xFFFF + +//****************************************************************************// + +//***********************Escrita no Display**********************************// +void forma () +{ + + tft.drawRoundRect(60, 90, 190, 40, 1, WHITE); // (x,y,x1,y1,s) + //tft.fillRoundRect(60, 90, 190, 40, 1, BLUE); + tft.setTextColor(RED); + tft.setTextSize(3); + tft.setCursor(70, 98); // Orientação X,Y + tft.println("RECTANGLE"); + + +} + +//****************************************************************************// + + + +void setup(void) +{ + + tft.reset(); + tft.begin(); + tft.setRotation(Orientation); + tft.fillScreen(BLACK); // Fundo do Display + forma(); + delay(1000); +} + +void loop() +{ + +} +