Shop OBEX P1 Docs P2 Docs Learn Events
"Error: Expected a directive".... Parallel-lcd 2x16.bsp — Parallax Forums

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

ArchiverArchiver Posts: 46,084
edited 2003-12-31 23:39 in General Discussion
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

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

'
[noparse][[/noparse] 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

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

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

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

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-12-31 04:13
    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: [noparse][[/noparse]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
    >
    > '
    [noparse][[/noparse] Declarations
    > ]
    > temp VAR Byte
    > Lcd_pin CON 0
    > Non_op CON 0
    > char VAR Byte
    >
    > '
    [noparse][[/noparse] 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
    >
    > '
    [noparse][[/noparse] Main Routine
    > ]
    > start:
    > FOR temp = 0 TO 27
    > READ temp,char
    > IF temp = 15 THEN Next_line
    > out:
    > LCDOUT 0,non_op,[noparse][[/noparse]char]
    > PAUSE 100 ' This number adjust the rate of displaying the text
    > NEXT
    > STOP
    >
    > '
    [noparse][[/noparse] Subroutines
    > ]
    > Next_line:
    > LCDCMD Lcd_pin,192 'places cursor to line 2
    > GOTO out
    >
    > [noparse][[/noparse]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/
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-31 04:16
    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... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=r_0jDhFmluHWkKmnAV4RKSJQjLLiWLm-AsTMq8EXghhtb-yPm6rTz_5HVcqotxTZH_CXIuqvri0]cdundorf@j...[/url
    Sent: Tuesday, December 30, 2003 9:54 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]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

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

    '
    [noparse][[/noparse] 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

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

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

    [noparse][[/noparse]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....
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-31 15:31
    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... [noparse][[/noparse]mailto:cdundorf@j...]
    > Sent: Tuesday, December 30, 2003 9:54 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]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
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-31 22:32
    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
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-31 23:38
    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 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=mpukCE-AsN7c1QLZgZ_4bjsSTuW-d1MbkveCK4nPnSnKf7aVgUkUzjjC3jsu-V-zvRMWuokKSsijn6r-9PAdvQ]cdundorf@k...[/url
    Sent: Wednesday, December 31, 2003 9:31 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]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... [noparse][[/noparse]mailto:cdundorf@j...]
    > Sent: Tuesday, December 30, 2003 9:54 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]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....
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-31 23:39
    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 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Dq5Koa5dsAK6J1T56NwlwXOW2Ilk_cuCozaoJUN4dFLtHrrsHqWGyYvU9fW-Wuc9QuXfJ6eyO8-VtbMxbNvuO3s]cdundorf@k...[/url
    Sent: Wednesday, December 31, 2003 9:31 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]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... [noparse][[/noparse]mailto:cdundorf@j...]
    > Sent: Tuesday, December 30, 2003 9:54 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]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....
Sign In or Register to comment.