Pages: [1]   Go Down
Author Topic: 7x71 LED display - font manipulation  (Read 1972 times)
0 Members and 1 Guest are viewing this topic.
Allentown, PA
Offline Offline
Newbie
*
Karma: 0
Posts: 39
Make it so!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a display that I'm able to address each LED on. There are 71 columns and 7 rows. I'm multiplexing the rows. The columns are setup on a cascade of shift registers.

I've picked up a few different 5x7 fonts to try, most are similar to this: http://www.hwsw.no/snippets/5x7_LCD_font.php. All of them are turned sideways for my purpose. If I write out the binary block, I can basically rotate it counter-clockwise 90-degrees and get a properly oriented digit. I'd like to know how I can do this manually or if there is something else out there that already has it for me.

Second, the following code seems to print a full byte when I only have 6 bits to push to it. This results in three columns between letters instead of just the one which is undesireable. How can I restrict the number of bits pushed onto the shift register?

Code:
// Print a letter onto the display
void print_letter() //(char c)
{
  int i;
  char e[] = {0x1C,0x22,0x22,0x3E,0x22,0x22,0x00}; //letter layer from top to bottom

  for (i=0; i<rowCount; i++)
  {
    shiftOut(ser, clk, MSBFIRST, e[i]);
    digitalWrite(rows[i], LOW);
    delay(2);
    digitalWrite(rows[i], HIGH);
  }

}

The complete code can be found at https://github.com/MakeLV/LED_Signage/tree/Elizabeth if that would be helpful.
Logged

Show Your Work
Offline Offline
Edison Member
*
Karma: 14
Posts: 1099
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just FYI:

http://arduino.cc/en/Reference/shiftOut

First sentence:

"Shifts out a byte of data one bit at a time."

I am guessing it doesn't do what you think it should do for you.  You have the source code as we all do.  Jump into it and write another version of the shiftOut function that allows you to limit the bit length to shift out.
 
As far as fonts (this is a repost):

// START REPOST //

A few days ago I was looking for some nice fonts for an led scroller I am making out of 8x8 matrices and after a while of searching I found a guy named cosmicvoid who uploaded this font creator, with some nice samples, on a different forum:

https://forum.crystalfontz.com/showthread.php?3619-Bitmap-font-editor-for-graphic-LCD (OLD VERSON)
https://forum.crystalfontz.com/showthread.php?6637-Text-graphic-C-code-for-CFAF320240&p=28164#post28164 (NEWER VERSION)

This forum concerns itself with LCD displays in paticular, but these fonts can be used anywhere bitmapped fonts are useful.

I link the old version because it has a 8-row sample font that is relatively decent.  The newer version has larger fonts which are nicer but will not work for a 8-row display (I am going to try an 8x48 with 6 8x8 displays display first and then 8x80 with 16 8x5 displays).  Some of them you could get to work if you had 24 rows, and I bet it would look great.  This software is nice because it has a code generation option that can generate a C-array with the bitmapped data in a columnar format which is perfect for using with a scrolling algorithm.  The newer version can write the code in a row-wise format too, if you want.

// END REPOST //

You may want to look at this.

Otherwise, I would say write a short program to translate your font data from row-wise data to column-wise data.
« Last Edit: January 02, 2013, 01:47:18 am by JoeN » Logged

I have only come here seeking knowledge. Things they would not teach me of in college.

Allentown, PA
Offline Offline
Newbie
*
Karma: 0
Posts: 39
Make it so!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, it is a limitation of the ShiftOut function. I'm stretching my programming skills, might as well take it another notch...

On the links, it looks to me like the part that allows for rotation is specific to the display the code is written for so not something I could reuse. Also, it seems all the fonts are 8 bits tall and I only have 7 to work with. Am I missing something here?
Logged

Show Your Work
Offline Offline
Edison Member
*
Karma: 14
Posts: 1099
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, it is a limitation of the ShiftOut function. I'm stretching my programming skills, might as well take it another notch...

On the links, it looks to me like the part that allows for rotation is specific to the display the code is written for so not something I could reuse. Also, it seems all the fonts are 8 bits tall and I only have 7 to work with. Am I missing something here?

You have to mess with this stuff a little before you get the idea.  The new editor has the better export options.  The old editor has the 8 height font.   So if you open SampleFont8 (from the old package) with the new editor you can do this export:



You will have to download this and look at it to understand.  Now if you wanted to use this font, yes, some characters like lowercase p and q use the 8th line.  You will actually have to fix that to make this font work in your setup.  Open the character, click your up-arrow, the p or q will go up a line.  Fixed.

Because this allows row or column based data you can use it whatever way is more convenient for your setup.  I don't know why you wouldn't be able to use this, all it does is produce data.  I was able to use it in my scroller.

In this message I describe a scrolling display I made using these fonts and the MAX7219 chips, source code is provided:

http://arduino.cc/forum/index.php/topic,120798.msg909347.html#msg909347


* FontEditor.png (65.84 KB, 714x403 - viewed 96 times.)
« Last Edit: January 02, 2013, 03:28:19 am by JoeN » Logged

I have only come here seeking knowledge. Things they would not teach me of in college.

Pages: [1]   Go Up
Jump to: