Best way to store array of bytes?


Closed Thread
Results 1 to 2 of 2
  1. #1
    Deadeye's Avatar
    Deadeye Guest

    Red face Best way to store array of bytes?

    All,

    I am using a 16F628 which AFAIK doesnt have the ability to store Data values.

    So I need to store every chariotor as an array of bytes.

    Im taking serial in then setting the chr and running this section.

    I know this is not the best way of doing it. Please advise a better or best practice way of doing such an operation.


    PrintChr:
    SELECT CASE chr
    CASE " "
    for i2=0 to 4
    LOOKUP2 i2,[$00,$00,$00,$00,$00,$00],glcd_dat
    GoSub send
    Next
    CASE "M"
    for i2=0 to 4
    LOOKUP2 i2,[$7F,$02,$0C,$02,$7F,$00],glcd_dat
    GoSub send
    Next
    CASE "e"
    for i2=0 to 4
    LOOKUP2 i2,[$38,$54,$54,$54,$18,$00],glcd_dat
    GoSub send
    Next
    CASE "h"
    for i2=0 to 4
    LOOKUP2 i2,[$7F,$08,$04,$04,$78,$00],glcd_dat
    GoSub send
    Next

    END SELECT

    ' Add space after
    glcd_dat = $00
    GoSub send

    RETURN



    Thanks

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Why not using the internal EEPROM OR better, an External one since you'll need, for sure, more than the actual PIC codeSpace to produce your whole set of Character.

    OR a mix of two... Internal one to store external EEPROM addess for each character and an external one for all your character.

    once it's done just use something like
    Code:
    CharString var byte[5]
    
    READ MyCharacter,ExternalEEPROMAddress
    I2CREAD sda,SCL,cont,ExternalEEPROMAddress,[str CharString\5]
    gosub send
    Keep your codespace for your code... not for your character font definition.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. Simple Array Demo
    By Archangel in forum Code Examples
    Replies: 5
    Last Post: - 15th February 2010, 04:46
  3. Working with indivividual bytes of an array
    By J_norrie in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 22nd January 2007, 19:16
  4. Array larger than 256 bytes
    By Ron Marcus in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 27th November 2005, 15:38
  5. Inverting a Word & Assigning Array To Bytes
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 25th August 2005, 23:44

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts