Results 1 to 7 of 7

Thread: "Error: Expected a directive".... Parallel-lcd 2x16.bsp

  1. #1

    Default

    I get this Windows error message

    "Error: Expected a directive"

    when downloading the .bsp code from my laptop to my BS2P40. Also, the
    second line of code in the Basic Stamp Editor automatically highlights:

    '{$PBASIC 2.5}

    I had the same code working fine when downloaded from my PC back in the
    Fall but now nothing but that error message. I've listed the full code
    below (downloaded from the Parallax site) in case it is of some use.

    There's nothing more frustrating than spending 2 to 3 hours on a problem
    and getting no where. Note, if I remove the second line of code,
    "'{$PBASIC 2.5}", the code downloads but the LCD display does nothing.
    What is this line supposed to do???

    Any ideas are appreciated

    Regards and Happy New Year,
    Chris Dundorf



    '{$STAMP BS2p}
    '{$PBASIC 2.5}

    'Title: Parallel_lcd 2X16.bsp
    'this code will work for the stamp2p and 2pe with the 2X16 parallel Lcd

    ' -----[ Declarations
    ]----------------------------------------------------
    temp VAR Byte
    Lcd_pin CON 0
    Non_op CON 0
    char VAR Byte

    ' -----[ Initialization
    ]--------------------------------------------------
    DATA "Hello, This is the LCD demo."
    Initlcd:
    PAUSE 1000
    FOR temp = 0 TO 2
    LCDCMD 0,48
    PAUSE 1
    NEXT
    LCDCMD Lcd_pin,32 'sets lcd in 4 bit mode
    LCDCMD Lcd_pin,40 'sets lcd to 2 line mode with 5x8 font
    LCDCMD Lcd_pin,12 'turns on display with no cursor
    LCDCMD Lcd_pin,6 'set to auto-increment cursor
    LCDCMD Lcd_pin,1 'clears display

    ' -----[ Main Routine
    ]----------------------------------------------------
    start:
    FOR temp = 0 TO 27
    READ temp,char
    IF temp = 15 THEN Next_line
    out:
    LCDOUT 0,non_op,[char]
    PAUSE 100 ' This number adjust the rate of displaying the text
    NEXT
    STOP

    ' -----[ Subroutines
    ]-----------------------------------------------------
    Next_line:
    LCDCMD Lcd_pin,192 'places cursor to line 2
    GOTO out

    [Non-text portions of this message have been removed]
    Last edited by ForumTools; 10-01-2010 at 02:58 AM. Reason: Forum Migration

  2. #2

    Default

    Chris,

    I just cut and pasted your code into the editor, and it compiled no problem.
    Are you using the latest version of the editor? The '{$PBASIC 2.5} directive
    tells the editor to use the latest syntax and include the latest commands
    suppported by the editor.

    Jonathan

    www.madlabs.info


    ----- Original Message -----
    From: <cdundorf@j...>
    To: <basicstamps@yahoogroups.com>
    Sent: Tuesday, December 30, 2003 7:53 PM
    Subject: [basicstamps] "Error: Expected a directive".... Parallel-lcd
    2x16.bsp


    > I get this Windows error message
    >
    > "Error: Expected a directive"
    >
    > when downloading the .bsp code from my laptop to my BS2P40. Also, the
    > second line of code in the Basic Stamp Editor automatically highlights:
    >
    > '{$PBASIC 2.5}
    >
    > I had the same code working fine when downloaded from my PC back in the
    > Fall but now nothing but that error message. I've listed the full code
    > below (downloaded from the Parallax site) in case it is of some use.
    >
    > There's nothing more frustrating than spending 2 to 3 hours on a problem
    > and getting no where. Note, if I remove the second line of code,
    > "'{$PBASIC 2.5}", the code downloads but the LCD display does nothing.
    > What is this line supposed to do???
    >
    > Any ideas are appreciated
    >
    > Regards and Happy New Year,
    > Chris Dundorf
    >
    >
    >
    > '{$STAMP BS2p}
    > '{$PBASIC 2.5}
    >
    > 'Title: Parallel_lcd 2X16.bsp
    > 'this code will work for the stamp2p and 2pe with the 2X16 parallel Lcd
    >
    > ' -----[ Declarations
    > ]----------------------------------------------------
    > temp VAR Byte
    > Lcd_pin CON 0
    > Non_op CON 0
    > char VAR Byte
    >
    > ' -----[ Initialization
    > ]--------------------------------------------------
    > DATA "Hello, This is the LCD demo."
    > Initlcd:
    > PAUSE 1000
    > FOR temp = 0 TO 2
    > LCDCMD 0,48
    > PAUSE 1
    > NEXT
    > LCDCMD Lcd_pin,32 'sets lcd in 4 bit mode
    > LCDCMD Lcd_pin,40 'sets lcd to 2 line mode with 5x8 font
    > LCDCMD Lcd_pin,12 'turns on display with no cursor
    > LCDCMD Lcd_pin,6 'set to auto-increment cursor
    > LCDCMD Lcd_pin,1 'clears display
    >
    > ' -----[ Main Routine
    > ]----------------------------------------------------
    > start:
    > FOR temp = 0 TO 27
    > READ temp,char
    > IF temp = 15 THEN Next_line
    > out:
    > LCDOUT 0,non_op,[char]
    > PAUSE 100 ' This number adjust the rate of displaying the text
    > NEXT
    > STOP
    >
    > ' -----[ Subroutines
    > ]-----------------------------------------------------
    > Next_line:
    > LCDCMD Lcd_pin,192 'places cursor to line 2
    > GOTO out
    >
    > [Non-text portions of this message have been removed]
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Yahoo! Groups Links
    >
    > To visit your group on the web, go to:
    > http://groups.yahoo.com/group/basicstamps/
    >
    > To unsubscribe from this group, send an email to:
    > basicstamps-unsubscribe@yahoogroups.com
    >
    > Your use of Yahoo! Groups is subject to:
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
    Last edited by ForumTools; 10-01-2010 at 02:58 AM. Reason: Forum Migration

  3. #3

    Default

    I pasted your code into the Version 2.1, Beta 1 editor/compiler and it
    does not complain about the $PBASIC directive. There is a FOR without a
    NEXT. You may want to consider indenting code blocks to make things
    easier to read. May I suggest "The Elements of PBASIC Style" that you
    can find on our web site.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    -----Original Message-----
    From: cdundorf@j... [mailto:cdundorf@j...]
    Sent: Tuesday, December 30, 2003 9:54 PM
    To: basicstamps@yahoogroups.com
    Subject: [basicstamps] "Error: Expected a directive".... Parallel-lcd
    2x16.bsp


    I get this Windows error message

    "Error: Expected a directive"

    when downloading the .bsp code from my laptop to my BS2P40. Also, the
    second line of code in the Basic Stamp Editor automatically highlights:


    '{$PBASIC 2.5}

    I had the same code working fine when downloaded from my PC back in the
    Fall but now nothing but that error message. I've listed the full code
    below (downloaded from the Parallax site) in case it is of some use.

    There's nothing more frustrating than spending 2 to 3 hours on a problem
    and getting no where. Note, if I remove the second line of code,
    "'{$PBASIC 2.5}", the code downloads but the LCD display does nothing.
    What is this line supposed to do???

    Any ideas are appreciated

    Regards and Happy New Year,
    Chris Dundorf



    '{$STAMP BS2p}
    '{$PBASIC 2.5}

    'Title: Parallel_lcd 2X16.bsp
    'this code will work for the stamp2p and 2pe with the 2X16 parallel Lcd

    ' -----[ Declarations
    ]----------------------------------------------------
    temp VAR Byte
    Lcd_pin CON 0
    Non_op CON 0
    char VAR Byte

    ' -----[ Initialization
    ]--------------------------------------------------
    DATA "Hello, This is the LCD demo."
    Initlcd:
    PAUSE 1000
    FOR temp = 0 TO 2
    LCDCMD 0,48
    PAUSE 1
    NEXT
    LCDCMD Lcd_pin,32 'sets lcd in 4 bit mode
    LCDCMD Lcd_pin,40 'sets lcd to 2 line mode with 5x8 font
    LCDCMD Lcd_pin,12 'turns on display with no cursor
    LCDCMD Lcd_pin,6 'set to auto-increment cursor
    LCDCMD Lcd_pin,1 'clears display

    ' -----[ Main Routine
    ]----------------------------------------------------
    start:
    FOR temp = 0 TO 27
    READ temp,char
    IF temp = 15 THEN Next_line
    out:
    LCDOUT 0,non_op,[char]
    PAUSE 100 ' This number adjust the rate of displaying the text NEXT STOP

    ' -----[ Subroutines
    ]-----------------------------------------------------
    Next_line:
    LCDCMD Lcd_pin,192 'places cursor to line 2
    GOTO out

    [Non-text portions of this message have been removed]


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Yahoo! Groups Links

    To visit your group on the web, go to:
    http://groups.yahoo.com/group/basicstamps/

    To unsubscribe from this group, send an email to:
    basicstamps-unsubscribe@yahoogroups.com

    Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
    Last edited by ForumTools; 10-01-2010 at 02:58 AM. Reason: Forum Migration

  4. #4

    Default

    John,

    1. I'm running Stamp Editor V1.32. Could this make a difference? In
    case it might I'm downloading V2.0.

    2. What is the function of this line of code? '{$PBASIC 2.5}

    3. Thanks for the suggestion on PBASIC Style. I just did a quick
    copy and paste from the .pdf file to include as a reference. This
    leads me to another question. Is there a way to copy and paste code
    from .pdf files and maintain the formating of tabs and line spaces,
    etc?

    Thanks,
    Chris
    p.s. Please use cdundorf@junodotcom for direct replies if any.

    <<<>>>

    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > I pasted your code into the Version 2.1, Beta 1 editor/compiler and
    it
    > does not complain about the $PBASIC directive. There is a FOR
    without a
    > NEXT. You may want to consider indenting code blocks to make things
    > easier to read. May I suggest "The Elements of PBASIC Style" that
    you
    > can find on our web site.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    > -----Original Message-----
    > From: cdundorf@j... [mailto:cdundorf@j...]
    > Sent: Tuesday, December 30, 2003 9:54 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [basicstamps] "Error: Expected a directive".... Parallel-
    lcd
    > 2x16.bsp
    >
    >
    > I get this Windows error message
    >
    > "Error: Expected a directive"
    >
    > when downloading the .bsp code from my laptop to my BS2P40. Also,
    the
    > second line of code in the Basic Stamp Editor automatically
    highlights:
    >
    >
    > '{$PBASIC 2.5}
    >
    > I had the same code working fine when downloaded from my PC back in
    the
    > Fall but now nothing but that error message. I've listed the full
    code
    > below (downloaded from the Parallax site) in case it is of some use.
    >
    > There's nothing more frustrating than spending 2 to 3 hours on a
    problem
    > and getting no where. Note, if I remove the second line of code,
    > "'{$PBASIC 2.5}", the code downloads but the LCD display does
    nothing.
    > What is this line supposed to do???
    >
    > Any ideas are appreciated
    >
    > Regards and Happy New Year,
    > Chris Dundorf
    >
    >
    >
    Last edited by ForumTools; 10-01-2010 at 02:58 AM. Reason: Forum Migration

  5. #5

    Default

    From: "dundorfdundorf" <cdundorf@k...>
    >
    > 1. I'm running Stamp Editor V1.32. Could this make a difference?
    > In case it might I'm downloading V2.0.
    >
    > 2. What is the function of this line of code? '{$PBASIC 2.5}
    >
    Yes, the editor version is your problem. The directive you ask about tells
    the compiler to use the updated syntax of PBasic 2.5, and the earlier editor
    cannot use that syntax. Install that new editor version and your problem
    should go away.

    Gary
    Last edited by ForumTools; 10-01-2010 at 02:58 AM. Reason: Forum Migration

  6. #6

    Default

    Please, please, please ... some of you are nervous about the "Beta 1"
    tag on our software. While it may not be perfect, we test everything
    pretty thoroughly before releasing, so please download and install
    Version 2.1, Beta 1 -- this is our latest and best version of the
    product. You must have at least version 2.0 in order to use the PBASIC
    2.5 syntax.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    -----Original Message-----
    From: dundorfdundorf [mailto:cdundorf@k...]
    Sent: Wednesday, December 31, 2003 9:31 AM
    To: basicstamps@yahoogroups.com
    Subject: [basicstamps] Re: "Error: Expected a directive"....
    Parallel-lcd 2x16.bsp


    John,

    1. I'm running Stamp Editor V1.32. Could this make a difference? In
    case it might I'm downloading V2.0.

    2. What is the function of this line of code? '{$PBASIC 2.5}

    3. Thanks for the suggestion on PBASIC Style. I just did a quick
    copy and paste from the .pdf file to include as a reference. This
    leads me to another question. Is there a way to copy and paste code
    from .pdf files and maintain the formating of tabs and line spaces,
    etc?

    Thanks,
    Chris
    p.s. Please use cdundorf@junodotcom for direct replies if any.

    <<<>>>

    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > I pasted your code into the Version 2.1, Beta 1 editor/compiler and
    it
    > does not complain about the $PBASIC directive. There is a FOR
    without a
    > NEXT. You may want to consider indenting code blocks to make things
    > easier to read. May I suggest "The Elements of PBASIC Style" that
    you
    > can find on our web site.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    > -----Original Message-----
    > From: cdundorf@j... [mailto:cdundorf@j...]
    > Sent: Tuesday, December 30, 2003 9:54 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [basicstamps] "Error: Expected a directive".... Parallel-
    lcd
    > 2x16.bsp
    >
    >
    > I get this Windows error message
    >
    > "Error: Expected a directive"
    >
    > when downloading the .bsp code from my laptop to my BS2P40. Also,
    the
    > second line of code in the Basic Stamp Editor automatically
    highlights:
    >
    >
    > '{$PBASIC 2.5}
    >
    > I had the same code working fine when downloaded from my PC back in
    the
    > Fall but now nothing but that error message. I've listed the full
    code
    > below (downloaded from the Parallax site) in case it is of some use.
    >
    > There's nothing more frustrating than spending 2 to 3 hours on a
    problem
    > and getting no where. Note, if I remove the second line of code,
    > "'{$PBASIC 2.5}", the code downloads but the LCD display does
    nothing.
    > What is this line supposed to do???
    >
    > Any ideas are appreciated
    >
    > Regards and Happy New Year,
    > Chris Dundorf
    >
    >
    >



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Yahoo! Groups Links

    To visit your group on the web, go to:
    http://groups.yahoo.com/group/basicstamps/

    To unsubscribe from this group, send an email to:
    basicstamps-unsubscribe@yahoogroups.com

    Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
    Last edited by ForumTools; 10-01-2010 at 02:58 AM. Reason: Forum Migration

  7. #7

    Default

    Some PDFs will let you copy. Select the text tool, highlight your text,
    then press Ctrl+C to copy. Some PDFs are encoded in such a way that
    prevents copying text -- none of ours from Parallax are encoded to
    prevent copying.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    -----Original Message-----
    From: dundorfdundorf [mailto:cdundorf@k...]
    Sent: Wednesday, December 31, 2003 9:31 AM
    To: basicstamps@yahoogroups.com
    Subject: [basicstamps] Re: "Error: Expected a directive"....
    Parallel-lcd 2x16.bsp


    John,

    1. I'm running Stamp Editor V1.32. Could this make a difference? In
    case it might I'm downloading V2.0.

    2. What is the function of this line of code? '{$PBASIC 2.5}

    3. Thanks for the suggestion on PBASIC Style. I just did a quick
    copy and paste from the .pdf file to include as a reference. This
    leads me to another question. Is there a way to copy and paste code
    from .pdf files and maintain the formating of tabs and line spaces,
    etc?

    Thanks,
    Chris
    p.s. Please use cdundorf@junodotcom for direct replies if any.

    <<<>>>

    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > I pasted your code into the Version 2.1, Beta 1 editor/compiler and
    it
    > does not complain about the $PBASIC directive. There is a FOR
    without a
    > NEXT. You may want to consider indenting code blocks to make things
    > easier to read. May I suggest "The Elements of PBASIC Style" that
    you
    > can find on our web site.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    > -----Original Message-----
    > From: cdundorf@j... [mailto:cdundorf@j...]
    > Sent: Tuesday, December 30, 2003 9:54 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [basicstamps] "Error: Expected a directive".... Parallel-
    lcd
    > 2x16.bsp
    >
    >
    > I get this Windows error message
    >
    > "Error: Expected a directive"
    >
    > when downloading the .bsp code from my laptop to my BS2P40. Also,
    the
    > second line of code in the Basic Stamp Editor automatically
    highlights:
    >
    >
    > '{$PBASIC 2.5}
    >
    > I had the same code working fine when downloaded from my PC back in
    the
    > Fall but now nothing but that error message. I've listed the full
    code
    > below (downloaded from the Parallax site) in case it is of some use.
    >
    > There's nothing more frustrating than spending 2 to 3 hours on a
    problem
    > and getting no where. Note, if I remove the second line of code,
    > "'{$PBASIC 2.5}", the code downloads but the LCD display does
    nothing.
    > What is this line supposed to do???
    >
    > Any ideas are appreciated
    >
    > Regards and Happy New Year,
    > Chris Dundorf
    >
    >
    >



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Yahoo! Groups Links

    To visit your group on the web, go to:
    http://groups.yahoo.com/group/basicstamps/

    To unsubscribe from this group, send an email to:
    basicstamps-unsubscribe@yahoogroups.com

    Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
    Last edited by ForumTools; 10-01-2010 at 02:58 AM. Reason: Forum Migration

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts