today I got my 3.5" TFT. I connected it like it is descriped in your tutorial via SPI. I tried the example sketch "graphicstest"...it worked fine!
After that I tried my own little code. Just getting some text on the tft.
But the text is blinking all the time. I am a beginner that´s why - I guess - it will be just a mistakes made through my own lack of knowledge,
I would be very happy if someone could tell me what I have to do in my code below for getting a permanent text on the tft (without blinking).
Code: Select all
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_HX8357.h"
#define TFT_CS 10
#define TFT_DC 9
#define TFT_RST 8
Adafruit_HX8357 tft = Adafruit_HX8357(TFT_CS, TFT_DC, TFT_RST);
void setup() {
Serial.begin(9600);
Serial.println("HX8357D Test!");
tft.begin(HX8357D);
}
void loop(void) {
testText();
delay(10000); // LOWER BLINKING FREQUENCY OF TEXT ON TFT
//delay(1); // HIGHER BLINKING FREQUENCY OF TEXT ON TFT
}
char testText() {
tft.fillScreen(HX8357_BLACK);
tft.setCursor(100, 100);
tft.setTextColor(HX8357_WHITE); tft.setTextSize(3);
tft.println("BLINK!!");
}
Best wishes,
Fabian