[SOLVED] LCD with UTFT library colours not correct

Hi. I have just got my touch screen working on my Mega 2560 using the library and code at http://www.rinkydinkelectronics.com and for some reason the code for the colours does not correspond to what is displayed... for example...

 myGLCD.setColor(255, 0, 0);

displays Blue

 myGLCD.setColor(0, 255, 0);

displays purple

 myGLCD.setColor(0, 0, 255);

displays yellow

myGLCD.setColor(VGA_BLACK);

displays white

myGLCD.setColor(VGA_WHITE);

displays black

I mean... WTH??? :o

Has anyone come across this or know how to fix it? I'm guessing it is something in the library that I can tweak but I'm barely able to write sketches.

Any advice would be appreciated. Thanks,
Steve

What library are you using? This one ? GitHub - adafruit/Adafruit_TouchScreen: Arduino library for 4-wire resistive touchscreens

UTFT - Rinky-Dink Electronics That one. :slight_smile:

Stevelondon:
UTFT - Rinky-Dink Electronics That one. :slight_smile:

Why don't you try the one i posted then?

I had the same problem and put it down to the LCD. Not actually faulty, just made that way. To add insult to injury, the display width didn't work either. If the library came from the LCD supplier, it is reasonable to assume that that is the best bet for it.

You might find that everything is fixable, just say black when you want white. The numbers appear to be for CMY when it should be RGB. If the display width is dodgey too, you can probably fix it by adding numbers to the command, but this means that centred text will never work.

Yesssssss Nick... Nice one... CMY makes perfect sense now. Thanks mate, that's it. Not a problem, at least now I can work out colour codes. I find the width is a little dodgy too. Center don't work and all seems to be a little left. I just use numbers and manually play with it till it looks central.

I will try the other library Zaxarias, I imagine that the library will have the script telling how much Red, how much green and how much blue make up VGA_BLACK, WHITE, etc. hopefully your choice of library will work.

Using CMY(K) values on an LCD seems a little strange to me - what happened to the 'K' value? Do you have a link to the screen you purchased?

Notice that I used the word "appears". I didn't say CMY(K), I said CMY.

Getting the library from the same supplier did not actually save me. I did not bother to change libraries, as I fixed the situation myself and I like the Henning Karlsen library. I bought the display over a year before I used it, no link, and Cold Tears would not talk about it.

Steve does not have the same display as me, but he does have the same problem .

Nick_Pyner:
and Cold Tears would not talk about it.

mmmm did you mention Sainsmart?? They stop reading as soon as they see that word!! And then proceed to tell you Sainsmart is enemy and you deserve what you get and don't ask for help from them or Henning....... Jeez....... I only mentioned Sainsmart to say how shit they were and that was the thanks I got!! :stuck_out_tongue:

Regards,

Graham

LoL, no. I just wanted to understand what was going on but, by that time, they were no longer selling that display anyway. Henning Karlsen responded very quickly but suggested that, in the absence of any knowledge about the controller, his library was probably never specifically intended to work with that display in the first place. In short, I was probably lucky to have what I had.

Link to screen

I think CMY would be right as the screen does look a little pink rather than red, cyan more than blue and well, yellow.

Just realised, that adafruit library is for touchscreen and I haven't even tried to get that working yet. :-/

Going to search google today to try and learn that. Wish me luck.

It's ok... I have gone through some of the other controller codes and find the right one for the board, now all is working fine.

Glad you got it figured out :smiley:

It would be beneficial for others if you would share your findings instead of just saying thanks it's ok now. These threads are here indefinitely, and do appear in Google searches, your last post is not particularly informative.

It would also be good if you could edit the topic title in your first post to include [Solved] or (Closed) so people don't need to spend more time on this subject.

Regards,

Graham

Sorry Graham, you're right, apologies. Was just so excited that it was finally wring properly.

The controller code that finally worked was ILI9327 and is now replying to RGB colours.

Thanks for everyones help.

Steve

Stevelondon:
Just realised, that adafruit library is for touchscreen and I haven't even tried to get that working yet. :-/

Going to search google today to try and learn that. Wish me luck.

Don't forget that Henning Karlsen also has the UTouch library which goes hand in hand with the UTFT Library.

Yea I saw that yesterday. Was a momentous day for me, learned how to do the screen, the touch screen and how to do multiple page menus. Well chuffed.