PICBASIC Pro examples will not compile????


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default couple questions

    What errors do you get?

    Do you have any specific examples which do not compile for you?

  2. #2
    Join Date
    Jul 2010
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    What errors do you get?

    Do you have any specific examples which do not compile for you?

    Right out of the MicroCode Studio Help:


    FOR B0 = 0 TO 5 ' Count from 0 to 5
    LOOKUP B0,["Hello!"],B1 ' Get character number B0 from string to variable B1
    SEROUT 0,N2400,[B1] ' Send character in B1 to Pin0 serially
    NEXT B0 ' Do next character

  3. #3
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by N6VMO_ View Post
    Right out of the MicroCode Studio Help:


    FOR B0 = 0 TO 5 ' Count from 0 to 5
    LOOKUP B0,["Hello!"],B1 ' Get character number B0 from string to variable B1
    SEROUT 0,N2400,[B1] ' Send character in B1 to Pin0 serially
    NEXT B0 ' Do next character
    You have to define your variables B0 and B1. Or you can add this include to your program. See page 24 ish of the manual.
    Code:
    Include "bs2defs.BAS"
    
    FOR B0 = 0 TO 5 ' Count from 0 to 5
    LOOKUP B0,["Hello!"],B1 ' Get character number B0 from string to variable B1
    SEROUT 0,N2400,[B1] ' Send character in B1 to Pin0 serially
    NEXT B0 ' Do next character

  4. #4
    Join Date
    Jul 2010
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    You have to define your variables B0 and B1. Or you can add this include to your program. See page 24 ish of the manual.
    Code:
    Include "bs2defs.BAS"
    
    FOR B0 = 0 TO 5 ' Count from 0 to 5
    LOOKUP B0,["Hello!"],B1 ' Get character number B0 from string to variable B1
    SEROUT 0,N2400,[B1] ' Send character in B1 to Pin0 serially
    NEXT B0 ' Do next character
    OK, I will give it a try...and read a bit more too.

    Thank you!

    John

  5. #5
    Join Date
    Jul 2010
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    What errors do you get?

    Do you have any specific examples which do not compile for you?
    ERROR Line 26: ID CURHOME2 is not a LABEL. (9600 BAUD HSERIN LOOKUP EXAMPLE rev 1.pbp)
    ERROR Line 33: Expected '['. (9600 BAUD HSERIN LOOKUP EXAMPLE rev 1.pbp)
    ERROR Line 33: Expected ']'. (9600 BAUD HSERIN LOOKUP EXAMPLE rev 1.pbp)
    ERROR Line 41: Expected ']'. (9600 BAUD HSERIN LOOKUP EXAMPLE rev 1.pbp)

    As you can see, my LOOKUP routine even makes a LABEL (line 26) have a syntax error.

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