Can only get 8 colors... [solved]

May I kindly ask to share your experience?

I am just testing a LCD display 360*240 Color LCD

include "SPI.h"

include "Adafruit_GFX.h"

include "Adafruit_ILI9341.h"

Basically I just wrote:

define BLACK 0x0000

define BLUE 0x001F

define RED 0xF800

define GREEN 0x07E0

define CYAN 0x07FF

define MAGENTA 0xF81F

define YELLOW 0xFFE0

define ORANGE 0xE880

define WHITE 0xFFFF

//later

tft.setTextColor(RED); tft.println("Hello world"); tft.setTextColor(ORANGE); tft.println("Hello world"); tft.setTextColor(YELLOW); tft.println("Hello world");

I get no difference beween RED and ORANGE, it's all RED. It looks that I can only get 8 colors.

Where is the problem? In the hardware, or in the driver?

Thank you

Go on. Visit the optician.

#define RED      0xF800     //R = 0b11111, G = 0b000000, B = 0b00000
#define ORANGE   0xE880     //R = 0b11101, G = 0b000100, B = 0b00000

You will not notice much difference in text colour. Write blocks of colour e.g. fillRect()

The Adafruit library should work fine. From memory, the ILI9341 does not even have an 8-colour mode. The ILI9488 does.

David.

david_prentice: Go on. Visit the optician.

The display shows only 8 colors. That's a fact. [EDIT] Fake news! The display can show an orange, I just needed to reduce red much more I am probably using the wrong library. Beside that, I am using the library on an ESP32.

You are an established member. Please post a link to the actual library. Please attach or link to your example sketch.

Your display module has been on the market for several years. It works well. There are many users.

Bodmer's TFT_eSPI is designed for Expressif boards. I would expect Adafruit to port their library to Expressif properly but I have not tried it myself.

David.

I was blind. The display has really many colors. The coror rendering is just not that accurate.

These definitions gave acceptable results:

// Colors from http://www.barth-dev.de/online/rgb565-color-picker/
#define BLACK    0x0000
#define BLUE     0x001F
#define NAVY     0x1810
#define RED      0xF800
#define GREEN    0x07E0
#define CYAN     0x07FF
#define MAGENTA  0xF81F
#define YELLOW   0xFFE0
#define ORANGE   0xF9C0
#define GREY1    0x6B6D
#define GREY2    0x4A49
#define WHITE    0xFFFF