Hello
I have TFT ILI9481 buy this TFT use Arduino MEGA with library use HX8357
I have this problem.
My video TFT FLASHES
My TFT flashes with this code;
#include <TFT_HX8357.h>
#include "Free_Fonts.h"
TFT_HX8357 tft = TFT_HX8357();
void setup() {
tft.begin();
tft.setRotation(1);
}
void loop() {
int xpos = 0;
int ypos = 40;
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// Select different fonts to draw on screen using the print class
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
tft.fillScreen(TFT_BLACK); // Clear screen to navy background
header("Draw free fonts using print class");
// For comaptibility with Adafruit_GFX library the text background is not plotted when using the print class
// even if we specify it.
tft.setTextColor(TFT_YELLOW, TFT_BLACK);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.setFreeFont(GLCD); // Select the orginal small GLCD font by using NULL or GLCD
tft.println(); // Move cursor down a line
tft.print("Original GLCD font"); // Print the font name onto the TFT screen
tft.println();
tft.println();
tft.setFreeFont(FSB9); // Select Free Serif 9 point font, could use:
// tft.setFreeFont(&FreeSerif9pt7b);
tft.println(); // Free fonts plot with the baseline (imaginary line the letter A would sit on)
// as the datum, so we must move the cursor down a line from the 0,0 position
tft.print("Serif Bold 9pt"); // Print the font name onto the TFT screen
tft.setFreeFont(FSB12); // Select Free Serif 12 point font
tft.println(); // Move cursor down a line
tft.print("Serif Bold 12pt"); // Print the font name onto the TFT screen
tft.setFreeFont(FSB18); // Select Free Serif 12 point font
tft.println(); // Move cursor down a line
tft.print("Serif Bold 18pt"); // Print the font name onto the TFT screen
tft.setFreeFont(FSB24); // Select Free Serif 24 point font
tft.println(); // Move cursor down a line
tft.print("Serif Bold 24pt"); // Print the font name onto the TFT screen
// delay(2000);
}
// Print the header for a display screen
void header(char *string)
{
tft.setTextSize(1);
tft.setTextColor(TFT_YELLOW, TFT_BLACK);
tft.fillRect(0, 0, 480, 30, TFT_BLUE);
tft.setTextDatum(TC_DATUM);
tft.drawString(string, 239, 2, 4); // Font 4 for fast drawing with background
}
If I put final to loop this code
delay(2000);
No flashes. But this can not be put each instruction
delay(2000);
I believe fillScreen be problem in library, I try other libraries for example UTFT and this will not happen. Any solution? Thanks and regards.