Jump to content
RobG

(Universal) Color LCD graphics library (2)

Recommended Posts

Seems is the mistake with color here.

After "setColor(COLOR_16_RED);" digit printed be BLUE and vice versa. May be here reversing bit order?

Share this post


Link to post
Share on other sites

I will take a look once I find some time, but this could be caused by different default settings of the display driver (I am setting only few basic things in configuration function.)

Should be an easy fix.

Share this post


Link to post
Share on other sites

I will take a look once I find some time, but this could be caused by different default settings of the display driver (I am setting only few basic things in configuration function.)

Should be an easy fix.

 

Yeah, it looks like RGB vs BGR colour ordering. I guess the displays that do this need some specific setup to pick the right mode. If they don't offer a setting for component order then the red and blue bits would need to be swapped in setColor.

Share this post


Link to post
Share on other sites
I have a msp430f5529'm using your lib ... however if I for example put

 

while (1) {

    clearscreen (1);

    setColor (COLOR_16_WHITE);

    drawString (5, 0, FONT_MD, "Menu");

}

 

in a while ... I can see it flashing ... is this normal? I thought it would blink so fast I could not see ...

 

if you can help me guide me too ... if I'm making a menu

Share this post


Link to post
Share on other sites

Hi Rob, 

 

I am trying to test your LCD on a CC3200 and the MSP430FR4133 launchpads - I have changed the pins for each board, however your code does not compile, giving such as "P1SEL is undefinded, P2SEL is undefined" and about 8 other definition errors. I'm not sure if there is a header file that I've misplaced or if the code is just not compatible with my boards.  Any help with getting the glass to work on my boards is appreciated!

 

Thanks

Share this post


Link to post
Share on other sites

Yeah, it looks like RGB vs BGR colour ordering. I guess the displays that do this need some specific setup to pick the right mode. If they don't offer a setting for component order then the red and blue bits would need to be swapped in setColor.

This was the case, at least for me. According to the datasheet I have for this display, the RGB/BGR direction is controlled by HW pin, so I made the following changes to the code in graphics.c file.

void setColor(u_int color) {
#if defined SWAP_TO_BRG
    colorLowByte = (color & 0x07FF) << 11 | (color & 0x07E0) | (color & 0xFFE0) >> 11;
    colorHighByte = ((color & 0x07FF) << 11 | (color & 0x07E0) | (color & 0xFFE0) >> 11) >> 8;
#else
    colorLowByte = color;
    colorHighByte = color >> 8;
#endif
}

void setBackgroundColor(u_int color) {
#if defined SWAP_TO_BRG
    colorLowByte = (color & 0x07FF) << 11 | (color & 0x07E0) | (color & 0xFFE0) >> 11;
    colorHighByte = ((color & 0x07FF) << 11 | (color & 0x07E0) | (color & 0xFFE0) >> 11) >> 8;
#else
    bgColorLowByte = color;
    bgColorHighByte = color >> 8;
#endif
}

Then I just defined "SWAP_TO_BRG" and the colors work as they should.

I know this is old discussion, but decided to post this anyway in hope that it might be helpful to someone.

Share this post


Link to post
Share on other sites

@@RobG Sorry for bumping this up,

but somehow I get the error:

 

 

Error[e46]: Undefined external "_delay_cycles" referred in main ( C:\Users\ulix\Documents\MSP430\display\Debug\Obj\main.r43 )

 

Where is the function: _delay_cycles defined and why do I get this error?

 

thanks

Share this post


Link to post
Share on other sites

@@RobG Sorry for bumping this up,

but somehow I get the error:

 

 

Where is the function: _delay_cycles defined and why do I get this error?

 

thanks

What IDE are you using? Function _delay_cycles() is part of the msp430 framework (<- I may not be using right word here?) in CCS (Code Composer Studio IDE).

Share this post


Link to post
Share on other sites

Is there an Energia library that support ILI9341 running on CC3200 or other simplelink launchpad?

I was happy for a minute as I found this post by Rei Vilo but then I discovered that the libraries are no more available for download, also I am not sure if they would run on CC3200

Another related question is: has anyone succeeded to use adafruit GFX libraries for Arduino (I mean with TI simplelink launchpad using Energia)?

Or what does it take to port the library?

Any help would be appreciated,

Thanks

Guy

 

Share this post


Link to post
Share on other sites

Hi!

Unfortunately, the LCD_screen Library Suite is no longer maintained. This thread is about the (Universal) Color LCD graphics library, developed by @RobG.

The ILI9341 is a pretty standard controller. Have you searched for an Arduino library?

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×