Teste de Tela
Dependencies: BSP_DISCO_F746NG LCD_DISCO_F746NG TS_DISCO_F746NG mbed
Diff: main.cpp
- Revision:
- 1:c04c41de6eef
- Parent:
- 0:9b2b74c6af2f
- Child:
- 2:ae8636da1252
--- a/main.cpp Tue Jun 27 17:49:44 2017 +0000 +++ b/main.cpp Fri Jun 30 20:22:56 2017 +0000 @@ -2,13 +2,13 @@ #include "TS_DISCO_F746NG.h" #include "LCD_DISCO_F746NG.h" #include "codigoBotaoReset.h" - +#include "logo.h" #define TEMPO_PRESSIONADO_BOTAO 0.01000f LCD_DISCO_F746NG lcd; TS_DISCO_F746NG ts; TS_StateTypeDef TS_State; - +Serial pc (USBTX, USBRX); typedef struct{ uint16_t x; @@ -118,7 +118,7 @@ void botaoAprender_callback(){ lcd.DisplayStringAt(37, 83, (uint8_t *)"Aprender ", LEFT_MODE); botaoAprender.updateFlag = 0; - lcd.DrawBitmap(0,0,(uint8_t *)img); + //lcd.DrawBitmap(0,0,(uint8_t *)img); } void botaoConfigurarVoltar_callback(){ @@ -127,11 +127,22 @@ } -void desenhaBotao(){ - lcd.SetTextColor(LCD_COLOR_CYAN) - lcd.FillCircle(330,76,32); +void desenharImagem(){ + uint16_t larg = 100; + uint16_t alt = 32; + int i; + int j; + int contador = 0; + for (i=0; i<alt; i++){ + for (j=0; j<larg; j++){ + lcd.DrawPixel(j,i,LOGOSOLID[contador]); + //pc.printf("%d;",LOGOSOLID[contador]); + contador++; + } + } } + int main() { uint16_t x, y; @@ -146,7 +157,9 @@ //Desenha tela Inicial resetTela(); - desenhaBotao(); + lcd.Clear(LCD_COLOR_RED); + desenharImagem(); + pc.printf("%d",LCD_COLOR_WHITE); while(1) { //Inicia os controles @@ -165,13 +178,16 @@ //Ação caso tenha clicado no botão if(botaoReset.updateFlag){ botaoReset_callback(); + pc.printf("Botao Reset"); } if(botaoAprender.updateFlag){ botaoAprender_callback(); + pc.printf("Botao Aprender"); } if(botaoConfigurarVoltar.updateFlag){ status++; botaoConfigurarVoltar_callback(); + pc.printf("Botao Configurar/Voltar"); } } }