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 would like to upload to arduino uno using my xbee radio but can't
I am trying to receive data using serial communication in Python, which I can
I'm having some very weird issues using the following hardware elements: Arduino Uno Wi-Fi
I am using this Makefile to compile my Arduino sketches which has the following
I'm planning to do a project using ATmega (I can't use an Arduino directly
I'm using an Arduino mega which has 4 serial ports. On the main serial
I'm using this Java program to communicate with an Arduino board. However, I'm having
I'm using an Arduino Uno R3 and when I send an AT command to
I have recently bought an Arduino Uno, which is basically an atMega328 avr processor
I program my IComSat board attached to an Arduino Uno. It works, but the

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.