ILI9488 + ESP32S3 Parallel Colour problem

I'm hoping a guru out there can help me
i recently bought an LCD display (ILI9488) with an ESP32S3 mounted on the back of it, already connected for parallel interface to LCD
initially everything went well until i started trying to use sprites
if i display a row of boxes on the screen red, yellow, green, blue, orange that works and colors are as expected
then i create a sprite with the same color sequence and push the sprite to the LCD below the boxes the colours come out as blue, magenta, red(ish), green, purple
i've tried altering invertDisplay(tue/false) to bring the colors back with no effect i am now wondering if anyone has had a similar problem, the code is below

#include "SPI.h"
#include "TFT_eSPI.h"

TFT_eSPI tft = TFT_eSPI();

TFT_eSprite clrs  = TFT_eSprite(&tft);


#define BLUE      0x001F
#define TEAL      0x0438
#define GREEN     0x07E0
#define CYAN      0x07FF
#define RED       0xF800
#define MAGENTA   0xF81F
#define YELLOW    0xFFE0
#define ORANGE    0xFC00
#define PINK      0xF81F
#define PURPLE    0x8010
#define GREY      0xC618
#define WHITE     0xFFFF
#define BLACK     0x0000

#define landscape     1
#define portrait      2
#define invportrait   3


void spriteBoxes() {
  clrs.createSprite(320, 100);
  clrs.fillScreen(WHITE);
  clrs.fillRect(10, 10, 30, 30, TFT_RED);
  clrs.fillRect(40, 10, 30, 30, TFT_YELLOW);
  clrs.fillRect(70, 10, 30, 30, TFT_GREEN);
  clrs.fillRect(100, 10, 30, 30, TFT_BLUE);
  clrs.fillRect(130, 10, 30, 30, TFT_ORANGE);
  tft.invertDisplay(false);
  clrs.pushSprite(0, 100);
  tft.invertDisplay(true);
}

void setup() {
  Serial.begin(115200);
  while (!Serial);

  tft.init();
  
  tft.invertDisplay(true);        // solves the color display issue
  
  tft.setRotation(portrait);

  tft.fillScreen(TFT_BLACK);
  tft.fillRect(10, 10, 30, 30, TFT_RED);
  tft.fillRect(40, 10, 30, 30, TFT_YELLOW);
  tft.fillRect(70, 10, 30, 30, TFT_GREEN);
  tft.fillRect(100, 10, 30, 30, TFT_BLUE);
  tft.fillRect(130, 10, 30, 30, TFT_ORANGE);
  
  spriteBoxes();
}

void loop(void) {
}

Draw a picture of your observation.
Post the code which shows the issue.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.