Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6862321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:38:52+00:00 2026-05-27T02:38:52+00:00

I am using Arduino Uno to power a Nokia 6100 LCD. In my program,

  • 0

I am using Arduino Uno to power a Nokia 6100 LCD. In my program, i take RGB 8 bit input which can be converted to 24 bit Hex using any available online conversion tools, that conversion i can take care of. However, the LCD library i am using only allows 12 bit Hex. how can i get the LCD to accept 24 bit Hex values instead of 12 and get the right colour on the screen. Or is there a way to change from 24 bit Hex to 12 bit hex in this case?

Thanks,
Faiz

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:38:52+00:00Added an answer on May 27, 2026 at 2:38 am

    Perhaps the LCD only understands 4bit channels? In any case, it sounds like that’s the limit of the library 🙂

    To convert to a 12-bit value (3 channels x 4 bits/channel) from a 24-bit value (3 channels x 8 bits/channel), just scale down each channel by a factor of 24 — that is, divide each 8-bit channel value [0-255] by 16 to obtain the approximate value in a 4-bit channel [0-15].

    Now, consider this: “dividing by 16” and “shifting right by 4” (non sign-extending) is effectively the same for unsigned 2’s complement integers. That is, the bottom 4 bits are just “thrown out”.

    Imagine this 24-bit value, in bits (padded in 32-bit integer):

    00000000RRRRrrrrGGGGggggBBBBbbbb 
    

    And this is the target value (padded in 16-bit integer):

    0000RRRRGGGGBBBB  // just get rid of the "small letter" bits :)
    

    And note that this can be obtained with a series of bit-wise operations:

    r12 = (hex24 >> 20) & 0xF
    g12 = (hex24 >> 12) & 0xF
    b12 = (hex24 >> 4) & 0xF
    hex12 = (r12 << 8) | (g12 << 4) | b12
    

    Happy coding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to receive data using serial communication in Python, which I can
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button
Using linq2sql I'm trying to take the string in txtOilChange and update the oilChange
I have Firmata working fine on an Arduino Uno, communicating over cable USB to
I have a robotics type project with an Arduino Uno , and to make
I want to send data to my Arduino board using Visual Studio and C.
I am using a bread boarded arduino. Inside my interrupt functions I want to
I have an Arduino-based device which connects through USB. I'd like to detect it
I can't seem to get the follow code right. This is a basic program

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.