This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

  • 0 voto(s) - 0 Media
  • 1
  • 2
  • 3
  • 4
  • 5
Arduino mega y pantalla TFT LCD Touch 2.4 Problema para pres
#1
Buenas, hace tiempo compre una pantalla TFT Touch para arduino y estoy intentando hacerla trabajar con un arduino mega.
Para trazos estaticos muy bien, pero cuando quiero representar una variable que va cambiando, como un tiempo, no se como hacerlo.
Si solo imprimo la variable me la va pisando, ver video.
https://youtu.be/ItJxJt3bz_8


Si antes de imprimir la variable relleno un marco donde lo hago con el color de fondo, esta me parpadea, ver video.
https://youtu.be/EwuGXbh-zDg


El codigo que utilizo es este, la primera linea rellena un rectangulo con el color de fondo.
Código:
tft.fillRect(0, 200, 320, 40, BLACK); // Rellenamos un rectangulo, si la habilito parpadea, sino la pisa
tft.setCursor(170,200);  // Colocamos el cursor
tft.setTextSize(3);    // Especificamos el tamaño del texto
  tft.setTextColor(RED); // Definimos el color del texto
  tft.println(time); // Escribimos por pantalla

Alguien podria ayudarme? Gracias


Archivos adjuntos
.jpg   2013.11.08_MEDIUM-1.jpg (Tamaño: 81.88 KB / Descargas: 753)
.jpg   Foto-Oct-31-12-59-43-PM.jpg (Tamaño: 112.91 KB / Descargas: 679)
  Responder
#2
Buenos Dias,

Prueba a actualizar el fondo negro, es decir a refrescar la pantalla solo cuando te cambie la variable, si la estas refrescando constantemente en cada ejecucion del codigo es probable que te pase eso.
  Responder
#3
Si, poco despues de poner el post le puse la condición de pintar variable solo si cambiaba y ahora si, supongo que es la forma de trabajar con estas pantallas.
Hasta ahora solo había trabajado con LCD.
Gracias
Saludos.

Código:
if (time1< time)
    {
   tft.fillRect(150, 190, 120, 40, BLACK); // Rellenamos un rectangulo
   tft.setCursor(170,200);  // Colocamos el cursor
   tft.setTextSize(3);    // Especificamos el tamaño del texto
   tft.setTextColor(RED); // Definimos el color del texto
   tft.println(time); // Escribimos por pantalla  */
   time1 = time;
    }
  Responder


Posibles temas similares…
Tema Autor Respuestas Vistas Último mensaje
  DUDA sistema de riego con arduino mega Natalia Miranda 12 2,090 01-04-2021, 12:57 AM
Último mensaje: asesorplaza1
  CONSULTA Error compilando para la tarjeta Arduino Mega or Mega 2560. minaki24fc 2 1,094 26-03-2021, 10:45 PM
Último mensaje: asesorplaza1
  problemas con arduino mega vs UGC jcvb 0 617 08-12-2020, 11:07 PM
Último mensaje: jcvb
  CONSULTA Re: Arduino Mega, 1 servo ,1 nema, 3 motor DC carlos hop 8 2,650 26-09-2018, 01:30 PM
Último mensaje: Shellmer
  No me reconoce el arduino mega. hansugrove 2 3,530 15-10-2017, 10:35 PM
Último mensaje: ismaelcd