NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » How are Characters drawn on the LED Array?

February 03, 2012
by tpdcoyne
tpdcoyne's Avatar

Hi,

I am trying to create things like cyrilic characters on my LED Array.

The trouble is, I do not understand how each pixel in the "5 x 5 led grid" which creates each character is turned on or off.

Page 34 of the LED Array Guide touches on this, but does not explain fully....

it shows the character of a Capital A and then codes it as:


  • *

  • *
  • *

{ 'A', 5, 0x1e, 0x05, 0x05, 0x05, 0x1e }

A clearly means the character "A" 5 clearly means that the character is five columns wide.

It then expands on 0x05, which represents the second column..... The 05 refers to the binary 00101, which obviously turns the top LED in that column "ON", the next one down "OFF", the third one down "ON" and the fourth and fifth ones down "OFF."

But what does the 0x in that group mean?

Also, this logic doesn't work for the first column, as it states 0x1e.

1 in binary is 00001, which would according to the above reasoning, turn the top LED on and all the others off. But the opposite is true! What does the "e" mean?

Also, in the font.h file, I see letters a,b,c,d,e,f What do they mean?

How can the character "=" be represented by 4 columns and then have 0x0a in all 5 columns?

I just don't get it..... can you help?

Thanks,

Tim

February 03, 2012
by Rick_S
Rick_S's Avatar

Think of it as your character lying on it's side. The "0x" simply means those are HEX values. Those HEX numbers represent each pixel of each column of the character.

So for the letter A;

0x1E  -  00011110
0x05  -  00000101
0x05  -  00000101
0x05  -  00000101
0x1E  -  00011110

See how the bits on the right side form an A? Remember the display is only 5 rows tall so the left three bits are not displayed and will always be zero.

The Equal sign is the same all the way down so if you look at the binary equivalent of 0x0A, you'll see it is 00001010. So fo that character, the 2nd and 4th row pixels will light 4 accross.

The 4 simply means that only the left 4 0x0A's will be used in the program for character generation the last 0x0A could be anything because it won't be displayed. My guess is they originally were going to have the equal sign be 5 pixels wide but later changed it to 4 and didn't zero out the last byte (because it isn't used anyway).

Rick

February 03, 2012
by tpdcoyne
tpdcoyne's Avatar

Hi Rick,

OK........

That has mades LOTS of sense, but I still don't get the 0A thing.....

00001010 is the number "10" in binary, right? (This is all brand new to me)

So why use 0x0A? Why not use 0x10?

Tim

PS. Thank you SO much for your help....

February 03, 2012
by tpdcoyne
tpdcoyne's Avatar

Also,

In the first column of the capital A font, 0x1e gives 00011110. That is the number 30 in binary. (I think)

so why not 0x30?

Why "1" and why "e"?

February 03, 2012
by tpdcoyne
tpdcoyne's Avatar

Hmmmmmm........

I may have just figured it out via this link....

http://www.computerhope.com/binhex.htm

Wow.

I have A LOT to learn......

:-)

Tim

Post a Reply

Please log in to post a reply.

Did you know that microcontrollers have two different kinds of memory, program space (flash) and SRAM? Learn more...