-
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 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
Forum Rules
Bookmarks