Skip to main content
antonius
Associate III
April 11, 2014
Question

Decoding bmp ?

  • April 11, 2014
  • 90 replies
  • 37501 views
Posted on April 11, 2014 at 11:21

Guys,

Does anyone of you have experience on decoding bmp ?

I want to display bmp file to my LCD...

Any clues ?

thanks

#i-have-a-clue
    This topic has been closed for replies.

    90 replies

    antonius
    antoniusAuthor
    Associate III
    April 28, 2014
    Tesla DeLorean
    Guru
    April 28, 2014
    Posted on April 28, 2014 at 16:25

    Does you display go white when you write 0xFFFF as the colour? If it doesn't I'd look more carefully at how it's set up and connected.

    LCD_Clear(0xFFFF);

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    antonius
    antoniusAuthor
    Associate III
    April 28, 2014
    Posted on April 28, 2014 at 16:35

    It's not going to be white, looks like transparent ?

    Tesla DeLorean
    Guru
    April 28, 2014
    Posted on April 28, 2014 at 17:07

    Ok, so what's the right RGB colour space number for White?

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    antonius
    antoniusAuthor
    Associate III
    April 28, 2014
    Posted on April 29, 2014 at 00:24

    Well, I have no clue on how to know white color for this LCD ?

    How to test white color for it ? thanks

    Tesla DeLorean
    Guru
    April 28, 2014
    Posted on April 29, 2014 at 01:30

    Well I think there is a problem with your display, or it's attachment. What you should probably do is test the primary colours, and try reading back the values programmed into the buffer.

    /* LCD colour */
    #define White 0xFFFF
    #define Black 0x0000
    #define Blue 0x001F
    #define Red 0xF800
    #define Magenta 0xF81F
    #define Green 0x07E0
    #define Cyan 0x7FFF
    #define Yellow 0xFFE0

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    antonius
    antoniusAuthor
    Associate III
    April 28, 2014
    Posted on April 29, 2014 at 01:36

    In this function ?

    void LCD_Clear(uint16_t Color)
    {
    uint32_t index=0;
    LCD_SetCursor(0,0); 
    LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
    for(index=0;index<76800;index++)
    {
    LCD_RAM=Color;
    printf(Color);
    }
    }

    antonius
    antoniusAuthor
    Associate III
    April 28, 2014
    Posted on April 29, 2014 at 01:43

    I've made a test function :

    void LCD_Color_test()
    {
    LCD_Clear(Black);
    delay_ms(1000);
    LCD_Clear(White);
    delay_ms(1000);
    LCD_Clear(Grey);
    delay_ms(1000);
    LCD_Clear(Blue);
    delay_ms(1000);
    LCD_Clear(Blue2);
    delay_ms(1000);
    LCD_Clear(Red);
    delay_ms(1000);
    LCD_Clear(Magenta);
    delay_ms(1000);
    LCD_Clear(Green);
    delay_ms(1000);
    LCD_Clear(Cyan);
    delay_ms(1000);
    LCD_Clear(Yellow);
    }

    Can you display white properly in your LCD ? thanks
    antonius
    antoniusAuthor
    Associate III
    April 28, 2014
    Posted on April 29, 2014 at 01:51

    It can do Grey, but can not do White, why is it ?

    Tesla DeLorean
    Guru
    April 29, 2014
    Posted on April 29, 2014 at 02:13

    Pretty sure the printf() there isn't appropriate.

    Yes, start by filling the panel with colour, and confirm those actually work, or if the colour is wrong.
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..