ARRAYWRITE to print acsi string


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158

    Default ARRAYWRITE to print acsi string

    I just upgraded to PBP3 because I need to do a bunch of asci strings to an LCD display, and I was told you can do this with arraywrite. Well, I can't get it to work. This code just prints the first letter, how can I make it work?

    Code:
    myarray var byte[20]
    
    arraywrite myarray, ["Hello World",0]
    lcdout myarray
    Shawn

  2. #2
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default Re: ARRAYWRITE to print acsi string

    Quote Originally Posted by spcw1234 View Post
    I just upgraded to PBP3 because I need to do a bunch of asci strings to an LCD display, and I was told you can do this with arraywrite. Well, I can't get it to work. This code just prints the first letter, how can I make it work?

    Code:
    myarray var byte[20]
    
    arraywrite myarray, ["Hello World",0]
    lcdout myarray
    Try

    For i = 0 to 19
    lcdout myarray[i]
    Next

    Norm

  3. #3
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: ARRAYWRITE to print acsi string

    I will give that a try, but that will not suit my application. This is how I am trying to write to my 4D Systems display, I was hoping to minimize having to do a bajillion serout commands, and instead setup an array for the text.

    Code:
    myarray var byte[20]
    
    arraywrite myarray, ["Hello World",0]
    
    serout2 tx, baud, ["s", 0, 1, 2, white1, white2, myarray, $00]
    gosub wait1 'check for ACK from display
    Shawn

  4. #4
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: ARRAYWRITE to print acsi string

    Try
    Code:
    LCDOUT $FE,$80, STR myarray

  5. #5
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: ARRAYWRITE to print acsi string

    Thanks! Exactly what I needed!
    Shawn

  6. #6
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: ARRAYWRITE to print acsi string

    Do same for SEROUT2. STR sends bytes until it reaches byte with value 0. So always keep last byte in array cleared, because pbp doesn't check boundary.

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Re: ARRAYWRITE to print acsi string

    Or use STR myarray\x where x is the number of bytes.

    Ioannis

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