Shop OBEX P1 Docs P2 Docs Learn Events
Controlling 5x7 led arrays — Parallax Forums

Controlling 5x7 led arrays

halfblinddadohalfblinddado Posts: 59
edited 2009-08-28 12:35 in BASIC Stamp
I want to control 2 5x7 led arrays. I have found a way to do it using 2 HC138 3 to 8 line decoders. I can program letters numbers animation and so on with 16 bit numbers. (See schematic and code attached).

a_right:
LEDs = 0
LEDs = %0000000000001110
LEDs = 0
LEDs = %0010010000010001
LEDs = 0
LEDs = %0100100000010001
LEDs = 0
LEDs = %0110110000011111
LEDs = 0
LEDs = %1001000000010001
LEDs = 0
LEDs = %1011010000010001
LEDs = 0
LEDs = %1101100000010001
RETURN

The first 6 bits control the decoders(which control·the rows)·and the second 10 bits control the columns.



As you can guess this takes up alot of program space and the The ASCII characters A-Z won't fit on the basic stamp.

My question is: Is there a good way to compress the data?

Thanks

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Everything is working so why do we pay him?"


"Nothing is working so why do we pay him?"

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-27 16:51
    You can easily store the font information using DATA statements and access it using READ statements. You need 7 x 2 = 14 bytes for each character. You can easily store a 64 character font in about 900 bytes (roughly 1/2 the EEPROM). Look at the chapters on the DATA and READ statements in the Basic Manual or the Stamp Editor's help file.
  • halfblinddadohalfblinddado Posts: 59
    edited 2009-08-28 00:49
    Does DATA store binary words? Is the only way to do this is to convert binary into decimal?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Everything is working so why do we pay him?"


    "Nothing is working so why do we pay him?"
  • dev/nulldev/null Posts: 381
    edited 2009-08-28 10:39
    DATA stores words if you prefix each item with Word.
    DATA Word "AB",Word "BC", etc...

    Beware that each item has 2 bytes (2 address positions) when you READ them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-08-28 12:35
    Take a look at another ways to do this with a BS2:



    http://forums.parallax.com/showthread.php?p=561144

    You can also use the MAX7219. Do a search for MAX7219 in this forum area.

    You will definately need external hardware chips to control this. This is probably a better project for a SX chip or Propellor.
Sign In or Register to comment.