Hi,
I'm new to the world of Arduino, and am using Uno board for the moment. I want to display an image multiple times in a 1.8inch TFT LCD. Now while the screen gets initialized, the whole screen turns white for a moment. Can the initialization be done without this flash?
The code is here:
#include <SPI.h>
#include <TFT.h> // Arduino TFT library
#define cs 10
#define dc 9
#define rst 8
TFT screen = TFT(cs, dc, rst);
int count=0;
void setup() {
// initialize the screen
screen.begin();
// make the background black
screen.background(0,0,0);
// set the stroke color to white
screen.stroke(255,255,255);
// set the fill color to white
screen.fill(255,255,255);
#define BACKCOLOR 0xFFFF // White
#define BLACK 0x0000 // Black
}
void loop() {
if (count<1) {
// draw a rectangle in the center of screen
screen.fillRect(0, 50, 160, 25, BACKCOLOR);
screen.fillRect(0, 0, 160, 25, BACKCOLOR);
screen.fillRect(0, 100, 160, 25, BACKCOLOR);
delay(2000);
screen.fillRect(0, 50, 160, 25, BLACK);
screen.fillRect(0, 0, 160, 25, BLACK);
screen.fillRect(0, 100, 160, 25, BLACK);
delay(1000);
count=count+1;
}
}