Confused by Arraywrite


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Confused by Arraywrite

    Well Richard, Making the statement LOOKUP2 does not seem to work. I have no idea where the data is coming from but, it is not what I set the ARRAYWRITE statement with. The only thing that is correct as I can see it is the string length.
    Dave Purola,
    N8NTA
    EN82fn

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: Confused by Arraywrite

    your correct dave , I have fallen into a trap set by mike, a sram array is not a valid source for any pbp lookup command . the concept seems flawed anyway surely the lookup table source should be the translated data table and the outarray data the index. we already have b0 as a pointer to the outarray data .
    my intent was just to demonstrate how to cycle through an array of variable length using a null as the end marker
    Warning I'm not a teacher

  3. #3
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Confused by Arraywrite

    Retypesnikrep, what are you wanting to display? Is there constants like "Temperature is " along with variables like "TempC VAR BYTE"? I've used the HD44780 based LCD for several projects. A display line would look like:

    Code:
    ARRAYWRITE LPsiA, [#LPsi]
        for b0 = 0 to 13
            LOOKUP b0,["Low PSI Set = "],b1
            PORTB = b1
            gosub Send
        next b0
        if LPsi < 10 then
            LPsiA[1] = LPsiA[0]
            LPsiA[0] = " "  
        endif 
        PORTB = LPsiA[0]
            gosub Send
        PORTB = LPsiA[1]
            gosub Send
    Here I use ARRAYWRITE to extract the individual digits of my pressure value LPsi into ARRAY LPsiA in ASCii format.

    I use LOOKUP to extract individual characters from the string "Low PSI Set = ".

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: Confused by Arraywrite

    basically I have a 1ms interrupt going on.

    I want this to check a buffer for stuff waiting to be sent to the screen, and if stuff waiting then send it via Hserout one chr at a time.

    OK so far.

    I want to fill my large buffer using array write as it contains text and variables... ie
    So it mimics the screen, as if I was writing it straight to the screen using hserout....

    arraywrite buffer, ["Temperature 1 is ",#Temp1,"C",32,"Temperature 1 is ",#Temp1,"C"]

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Confused by Arraywrite

    Thanks Richard, I do understand now. By the way, What's Mpgmike and Retepsniarep talking about? It seems as though this tread has been hijacked.
    Dave Purola,
    N8NTA
    EN82fn

  6. #6
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Confused by Arraywrite

    Richard, After chatting with Charles, I decided to eliminate the "lookup2" statement and just pass the array variable to the serial buffer routine. All is working now. Nice and neat. Here is the code:

    '************************************************* ********************
    SERIALOUT2: 'OUTPUT SERIAL STRING TO PORT 2
    '************************************************* ********************
    BYTEIN = 0
    WHILE OUTARRAY(BYTEIN)
    TX_BYTES2(TX_OUTPUT2) = OUTARRAY(BYTEIN)
    BYTEIN = BYTEIN + 1
    GOSUB SNDCHAR2 'INCREMENT BUFFER POINTERS
    WEND
    RETURN
    Dave Purola,
    N8NTA
    EN82fn

Similar Threads

  1. Arraywrite word
    By netstranger.nz in forum PBP3
    Replies: 0
    Last Post: - 6th August 2013, 05:22
  2. ARRAYWRITE lenght
    By pedja089 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th June 2012, 15:45
  3. Question about ARRAYWRITE
    By circuitpro in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th July 2010, 21:00
  4. ArrayWrite question
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th January 2010, 00:42
  5. Arrayread,arraywrite
    By suded in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th November 2009, 08:36

Members who have read this thread : 2

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