Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add fix for gamma control on IL9486 boards #3266

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

mnye
Copy link

@mnye mnye commented Apr 2, 2024

I've got this board: http://www.lcdwiki.com/4.0inch_SPI_Module_ILI9486 and have noticed issues with what appears to be the gamma correction set by default in the ILI9486 driver.

When you use this board straight out of the box, R/G/B + black/white and the screen itself all display perfectly fine. It is only when you go into the gradients and shades of colours that you notice they are not correct.

My test code was along the lines of this loop:

` tft.fillScreen(0x8630); // 34352
tft.setTextSize(1);
tft.setTextFont(1);

int r=0,g=0,b=0;
while (!killSwitch) {
tft.setCursor(5, 5);
tft.printf("r=%d,g=%d,b=%d",r,g,b);
tft.fillRect(100, 100, 300, 200, ((r << 11) | (g << 5) | b));
g++;
if (g > 63) { r++; b++; g = r; }
if (r > 63) { r = 0; b = 0; }
delay(100);
}`

The datasheet for the chip: https://www.hpinfotech.ro/ILI9486.pdf which explains the E0 / E1 gamma control function.

As per this discussion: #3018, commenting out the gamma control commands makes my screen work perfectly.

I would suggest as per this pull request if ILI9486_Init.h could take in config from User_Setup.h to make this control more explicit and probably save users time debugging not understanding the gamma control issue. Hope this at least provides visibility on this fix and saves someone in the future a few hours of their day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant