Hallo Leute,
Ich habe mir von www.Sainsmart.com das 1,8 Tft Display bestellt und an einen Arduino Uno angeschlossen.
Dann noch die passende library dazu geladen, und den Testcode (rotationstest) auf den Arduino upgeloadet.
Alles funktioniert super wie es sein sollte.
Dann habe ich mir den Code so gekürzt das er nur 4 texte auf dem Tft anzeigt, was er auch tut, nur ist der Hintergrund nicht schwarz sonder so grau und immer nach meinem delay zuckt er einmal und wird dann kurz super schön schwarz ....
Ich verstehe jedoch nicht was das Problem ist? Oder liegt es daran das er nach der delayzeit wieder das Display schwarz färbt?
Wenn ja wie kann ich das umgehen das das Display dauerhaft voll schwarz bleibt und nur die texte in Farbe gut zu sehen sind?
Habt ihr mit dem Tft Erfahrung oder sonst eine Idee was ich falsch mache?
Hier der gekürzte code:
#define sclk 4 // SCL Display
#define mosi 5 // SDA Display
#define cs 6 // CS Display
#define dc 7 // RS/DC Display
#define rst 8 // RES Display
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>
// Option 1: use any pins but a little slower
Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, mosi, sclk, rst);
void setup(void) {
Serial.begin(9600);
Serial.print("hello!");
// If your TFT's plastic wrap has a Red Tab, use the following:
tft.initR(INITR_REDTAB); // initialize a ST7735R chip, red tab
// If your TFT's plastic wrap has a Green Tab, use the following:
//tft.initR(INITR_GREENTAB); // initialize a ST7735R chip, green tab
Serial.println("init");
tft.setTextWrap(false); // Allow text to run off right edge
tft.fillScreen(ST7735_BLACK);
}
void loop(void) {
Text();
}
void Text() {
tft.setCursor(0, 30);
tft.setTextColor(ST7735_GREEN);
tft.setTextSize(2);
tft.println("Testtext");
tft.setTextColor(ST7735_GREEN);
tft.setTextSize(2);
tft.println("Testtext");
tft.setTextColor(ST7735_GREEN);
tft.setTextSize(2);
tft.println("Testtext");
tft.setTextColor(ST7735_GREEN);
tft.setTextSize(2);
tft.print("Testtext");
delay(5000);
}
Gruß Marc