i have read following link :slight smile:
i having the text color and back ground color selection problem .
Only color text is happening and not back ground color is not happening .
i am trying to display the hour , minutes , seconds .
please have the look on code and display
#include "SPI.h"
#include <Adafruit_GFX.h>
#include <ILI9488.h>
#include <RTClock.h>
#include <Fonts/FreeMonoBold18pt7b.h>
RTClock rtclock(RTCSEL_LSE);
tm_t curTime;
const char *months[] = {"???", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
const char *delim = " :";
char bld[40];
uint8_t str2month(const char * d)
{
uint8_t i = 13;
while((--i) && strcmp(months[i], d));
return i;
}
#define TFT_CS PA4
#define TFT_DC PB3
#define TFT_LED PB0
#define TFT_RST PB4
// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
ILI9488 tft = ILI9488(TFT_CS, TFT_DC, TFT_RST);
// If using the breakout, change pins as desired
//Adafruit_ILI9488 tft = Adafruit_ILI9488(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
void setup() {
Serial.begin(9600);
Serial.println("ILI9488 Test!");
rtclock.breakTime(rtclock.now(), curTime);
// if(curTime.year+1970<2019) setBuildTime(curTime);
tft.begin();
testFilledRoundRects();
tft.setRotation(3);
tft.setFont(&FreeMonoBold18pt7b);
tft.fillScreen(ILI9488_WHITE);
unsigned long start = micros();
delay(500);
}
char buf[25];
char *dowTxt[] = {"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", "??"};
char *dowLongTxt[] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "??"};
void loop(void) {
tft.setCursor(0,0+50);
tft.setTextColor(ILI9488_BLUE, ILI9488_WHITE); tft.setTextSize(1);
tft.println("LIGHTING PROJECT");
showClock(1);
delay(1000);
}
unsigned long testFillScreen() {
unsigned long start = micros();
tft.fillScreen(ILI9488_BLACK);
tft.fillScreen(ILI9488_RED);
tft.fillScreen(ILI9488_GREEN);
tft.fillScreen(ILI9488_BLUE);
tft.fillScreen(ILI9488_BLACK);
return micros() - start;
}
unsigned long testFilledRoundRects() {
unsigned long start;
int i, i2,
cx = tft.width() / 2 - 1,
cy = tft.height() / 2 - 1;
tft.fillScreen(ILI9488_WHITE);
start = micros();
for(i=min(tft.width(), tft.height()); i>20; i-=6) {
i2 = i / 2;
tft.fillRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(0, i, 0));
}
return micros() - start;
}
void showClock(int seconds)
{
rtclock.breakTime(rtclock.now(), curTime);
tft.setTextColor(ILI9488_RED, ILI9488_WHITE); tft.setTextSize(1);
if(seconds)
snprintf(buf, 25, " %d:%02d:%02d ", curTime.hour, curTime.minute, curTime.second);
else
snprintf(buf, 25, " %d:%02d ", curTime.hour, curTime.minute);
tft.println(buf);
snprintf(buf, 25, "% 02d.%02d.%d ", curTime.day, curTime.month, curTime.year+1970);
tft.println(buf);
snprintf(buf, 25, " %s ", dowLongTxt[curTime.weekday]);
tft.println(buf);
}

