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

  • Home
  • SEARCH
  • 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 988587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:39:30+00:00 2026-05-16T05:39:30+00:00

I am working on an embedded C project. I have an LCD display and

  • 0

I am working on an embedded C project. I have an LCD display and for each character there is a 5×7 dot matrix. To display a specific character you have to shift in 5 bytes that correlate with the dots to turn on. So I need to make some kind of look-up table with a key where I can pass in an ASCII character, and get an array of 5 bytes returned…
For example, a call to this function like this,

GetDisplayBytes('A');

should return `an array like this…

C[0] = 0x7E : C[1] = 0x90 : C[2] = 0x90 : C[3] = 0x90 : C[4] = 0x7E

What would be the best way to do this in C?

  • 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-16T05:39:30+00:00Added an answer on May 16, 2026 at 5:39 am

    I would make arrays for the contiguous ASCII blocks you want to use. data. Something like this:

    uint8_t displayBytesLetters[] = 
    {
      0x73, 0x90, 0x90, 0x90, 0x73, // 'A'
      .
      .
      .
    };
    
    uint8_t displayBytesDigits[] = 
    {
      0x12, 0x15, 0x25, 0x58, 0x80, // '0'
      .
      .
      .
    };
    

    Then your GetDisplayBytes() is something like:

    uint8_t *GetDisplayBytes(char c)
    {
      if (isdigit(c))
        return &displayBytes[5*(c - '0')];
      else if (isupper(c))
        return &displayBytes[5*(c - 'A')];
      else
        return NULL;
    }
    

    Pass the returned pointer to whatever function outputs the data:

    void DoDisplay(uint8_t *displayBytes)
    {
      int i;
      for (i = 0; i < 5; i++) 
      {
         SendOutput(displayBytes[i]);
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on an embedded project with a friend and I like
There are happy people working with boost and Qt. In my current embedded project
I'm working on an embedded Linux project that interfaces an ARM9 to a hardware
I'm working on an embedded C project that depends on some external HW. I
I've been working on an embedded C/C++ project recently using the shell in Tornado
I am working on a project that involves an embedded system which runs a
I'm working on an embedded project that has no file system, and our kludge
In a recent embedded project, we have used the following svn structure: project branches
I am working on an embedded Windows CE project and am interested in accessing
I am working on a project built on python 2.4 (It is an embedded

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.