Beginner trying to use arrays


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Okay so you're hoping to store these parameters in EEProm as a table to recall later.

    Then an array is not what you need. You need the following commands DATA, and READ. Take a look at each in the manual.

    Basically you're going to use DATA to create the table in EEPROM. Then READ to read info from eeprom into variables. Everything is one byte at a time for the most part.

  2. #2
    captain's Avatar
    captain Guest


    Did you find this post helpful? Yes | No

    Talking

    Thanks for the info. Data refers me to WRITECODE due to the fact that I want to have it written realtime. The end result will have the end user enter enter the desired times via PC software. Any further info on either WRITE CODE or the PC interface would be apreciated.

  3. #3
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Don't use writecode. The manual is very specific about writecode using program space for storage not EEProm. WRITE is used to store information to EEPROM. Best bet is to consult your manual and experiment. The forum can help but you have to have a fairly specific questions.

    Enjoy.

  4. #4
    Join Date
    Oct 2005
    Posts
    34


    Did you find this post helpful? Yes | No

    Talking Arrays

    To use arrays, first you have to declare the array variable

    Sample VAR BYTE[16]
    X VAR BYTE

    then if you want to write this array to eeprom you have to write one part (Byte) of the array at a time I do it with a FOR/NEXT loop

    FOR X = 0 to 15
    WRITE X, Sample[X]
    NEXT X

    and to read it back to the array do the same but use READ

    FOR X = 0 to 15
    READ X, Sample[X]
    NEXT X

    And to print the array on LCD

    LCDOUT $fe, 1, STR Sample\16

    And to send it with SEROUT you have to send the bytes one by one

    SEROUT PORTA.7,T9600, [Sample[0],Sample[1],Sample[2],Sample[3],Sample[4],Sample[5],Sample[6],Sample[7],Sample[8],Sample[9],Sample[10],Sample[11],Sample[12],Sample[13],Sample[14],Sample[15]]

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 08:55
  2. Advanced Arrays
    By GoldStar in forum General
    Replies: 2
    Last Post: - 16th May 2009, 07:58
  3. HEX value o/p to PC and arrays
    By Christos_K in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 23rd August 2005, 02:10
  4. word arrays and eeprom
    By Acetronics2 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th January 2005, 08:36
  5. storing arrays and reading arrays
    By Yue in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 5th March 2004, 23:03

Members who have read this thread : 0

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