Results 1 to 7 of 7

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

Threaded View

  1. #1


    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."
    PAUSE 1000
    FOR temp = 0 TO 2
    LCDCMD 0,48
    PAUSE 1
    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
    FOR temp = 0 TO 27
    READ temp,char
    IF temp = 15 THEN Next_line
    LCDOUT 0,non_op,[char]
    PAUSE 100 ' This number adjust the rate of displaying the text

    ' -----[ Subroutines
    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 01:58 AM. Reason: Forum Migration


Posting Permissions

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