//=============================================================================
//=============================================================================
#include <ILI9488_t3.h>
#include <ILI9488_t3_font_Arial.h>
#include <ILI9488_t3_font_ArialBold.h>
#define TFT_RST 8
#define TFT_DC 9
#define TFT_CS 10
uint16_t our_pallet[] = {
ILI9488_BLACK, ILI9488_RED, ILI9488_GREEN, ILI9488_BLUE, ILI9488_WHITE,
ILI9488_YELLOW, ILI9488_ORANGE, ILI9488_CYAN, ILI9488_PINK };
ILI9488_t3 tft = ILI9488_t3(TFT_CS, TFT_DC, TFT_RST);
//=============================================================================
// Setup
//=============================================================================
void setup()
{
while (!Serial && (millis() < 3000));
Serial.begin(115200);
tft.begin();
tft.setRotation(3); // 180
delay(100);
tft.fillScreen(ILI9488_BLACK);
delay(250);
}
//=============================================================================
// Loop
//=============================================================================
void loop()
{
tft.useFrameBuffer(false);
uint32_t start_time = millis();
tft.fillScreen(ILI9488_BLACK);
tft.fillScreen(ILI9488_RED);
tft.fillScreen(ILI9488_GREEN);
tft.fillScreen(ILI9488_BLUE);
tft.fillScreen(ILI9488_WHITE);
tft.fillScreen(ILI9488_YELLOW);
tft.fillScreen(ILI9488_ORANGE);
tft.fillScreen(ILI9488_CYAN);
tft.fillScreen(ILI9488_PINK);
tft.fillRect(0, 0, tft.width()/2, tft.height()/2, ILI9488_RED);
tft.fillRect(tft.width()/2, 0, tft.width()/2, tft.height()/2, ILI9488_GREEN);
tft.fillRect(0, tft.height()/2, tft.width()/2, tft.height()/2, ILI9488_BLUE);
tft.fillRect( tft.width()/2, tft.height()/2, tft.width()/2, tft.height()/2, ILI9488_YELLOW);
uint32_t non_frame_buffer_time = millis() - start_time;
delay(1000);
tft.setPallet(our_pallet, sizeof(our_pallet)/sizeof(our_pallet[0]));
tft.colorsArePalletIndex(true);
tft.useFrameBuffer(true);
start_time = millis();
tft.fillScreen(0);
tft.fillScreen(8);
tft.fillScreen(7);
tft.fillScreen(6);
tft.fillScreen(5);
tft.fillScreen(4);
tft.fillScreen(3);
tft.fillScreen(2);
tft.fillScreen(1);
tft.fillRect(0, 0, tft.width()/2, tft.height()/2, 4);
tft.fillRect(tft.width()/2, 0, tft.width()/2, tft.height()/2, 5);
tft.fillRect(0, tft.height()/2, tft.width()/2, tft.height()/2, 6);
tft.fillRect( tft.width()/2, tft.height()/2, tft.width()/2, tft.height()/2, 7);
tft.updateScreen();
uint32_t frame_buffer_time = millis() - start_time;
delay(1000);
tft.useFrameBuffer(false);
tft.fillScreen(ILI9488_BLACK);
tft.setTextColor(ILI9488_RED);
tft.setTextSize(3);
tft.setCursor(0, 130);
tft.printf("Reg: %d\nFB: %d", non_frame_buffer_time, frame_buffer_time);
tft.updateScreen();
delay(2500);
}