Hi, I was recently working on a new project which displayed time from a real time module to a Arduino TFT display using an Arduino UNO as the main board, however I'm still having trouble with it displaying anything on the screen as when I wire everything up and power the Arduino it just displays a white blank screen,
For the wiring I've made this diagram, (all parts in this diagram represent what I have):
And for the code I've added this:
I have double checked that the library's do work with my display. #include <Wire.h>
RTC_DS3231 rtc;
char t[32];
#include "Adafruit_GFX.h"
#include "MCUFRIEND_kbv.h"
MCUFRIEND_kbv tft;
#include "Fonts/FreeSans9pt7b.h"
#include "Fonts/FreeSans12pt7b.h"
#include "Fonts/FreeSerif12pt7b.h"
#include "FreeDefaultFonts.h"
#define PI 3.1415926535897932384626433832795
#define WHITE 0xFFFF
int col[8];
void showmsgXY(int x, int y, int sz, const GFXfont *f, const char *msg)
{
int16_t x1, y1;
uint16_t wid, ht;
tft.setFont(f);
tft.setCursor(x, y);
tft.setTextColor(0x0000);
tft.setTextSize(sz);
tft.print(msg);
}
void setup()
{
Serial.begin(9600);
Wire.begin();
rtc.begin();
rtc.adjust(DateTime(F(__DATE__),F(__TIME__)));
//rtc.adjust(DateTime(2019, 1, 21, 5, 0, 0));
tft.reset();
uint16_t ID = tft.readID();
tft.begin(ID);
tft.setRotation(1);
tft.invertDisplay(true);
tft.fillScreen(0xffff);
}
void loop()
{
DateTime now = rtc.now();
sprintf(t, "%02d:%02d:%02d %02d/%02d/%02d", now.hour(), now.minute(), now.second(), now.day(), now.month(), now.year());
Serial.print(F("Date/Time: "));
Serial.println(t);
showmsgXY(170, 250, 2, &FreeSans9pt7b, t);
delay(1000);
}
I personally think that the issue is with the wiring however again I'm not sure if it is the code or wiring which I'm messing up, as when I wire everything up it just displays a blank screen like this:
Final goal target to be displayed on the screen:
If anyone has worked with such displays and knows what's the issue any help would be highly apricated, thanks!