SerOut and Arrays


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004
    Location
    nebraska
    Posts
    79

    Default SerOut and Arrays

    Hi,
    I'm using the serout command to communicate to a serial LCD Module. I've searched for about an hour and a half and have found nothing. My Question is can a person use a array variable in the serout comand like this.
    Serout pin,6,[ControlVar,ArrayVariable.0]
    My LCD is 16 Characters wide. What I want to do is have an array with 16 elements which would be one for each character. Then I can just load the array with the values I want and serout to my LCD once.
    If even possible a little example of arrays with the serout command would be nice

    Thanks
    Shawn

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


    Did you find this post helpful? Yes | No

    Default

    You'll need to use HSEROUT or SEROUT2
    Serout....[STR ArrayVar]

    look into the manual in the SEROUT2 section.
    Steve

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

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    You can't do that with SEROUT, but you CAN with SEROUT2... see the manual... quick example...

    DataPin var PortB.0
    Counter var Byte
    DisplayString var Byte [18]

    DisplayString(0)=$FE
    DisplayString(1)=$01
    For CounterA=2 to 16
    DisplayString(CounterA)=CounterA+63
    Next CounterA

    SEROUT2 DataPin,T9600,[STR DisplayString\16]

    This should clear the screen and display "ABCDEFGHIJKLMNOP" on the first line (assuming you have a 16 character display).

Similar Threads

  1. HELP! Serial input between Pic and PC (urgent)
    By cmyew in forum mel PIC BASIC Pro
    Replies: 34
    Last Post: - 10th December 2007, 13:05
  2. Beginner trying to use arrays
    By captain in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 3rd November 2007, 07:20
  3. Serial interface with RFID reader
    By brid0030 in forum Serial
    Replies: 8
    Last Post: - 23rd January 2007, 06:23

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