Shop OBEX P1 Docs P2 Docs Learn Events
Bs2 why does this give error — Parallax Forums

Bs2 why does this give error

SPENCESPENCE Posts: 204
edited 2005-12-26 01:33 in BASIC Stamp
I GET ERROR MESSAGE SYMBOL ALREADY DEFINED.

THE ERROR OCCUS IF I HAVE THE ENTIRE PROGRAM LOADED OF JUST THE FOLLOWING PART.

' LCD16x2.BS2
' PROGRAM MESSAGE ON LCD MODULE 16 X 2
' This program demonstrates initialization and printing on a 2 x 16
' character LCD display.


'FROM STAMP WORKS PAGE 67


' {$STAMP BS2}
' {$PBASIC 2.5}

e CON 0 'LCD ENABLE PIN (1 = ENABLED)
RS CON 3 'REGISTER SELECT (1 - CHAR)
LCDOUT VAR OUTB '4-BIT LCD DATA

CLRLCD CON $01 'CLEAR THE LCD


CrsrHm CON $02 'MOVE CURSOR TO HOME POSITION
CRSRLF CON $10 'MOVE CURSOR LEFT THIS LINE GIVES ERROR
CRSRRT CON $14 'MOVE CURSOR RIGHT
DISPLF CON $18 'SHIFT DISPLAYED CHARACTERS LEFT

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
73
SPENCE
K4KEP

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-25 06:47
    Spence,

    ·· The CRSRLF and the following CRSRRT are reserved words for the BASIC Stamp (Used by DEBUG)· you will need to change these to something else.· Also, LCDOUT is a keyword on the BS2p series BASIC Stamps, and thus shouldn't be used either.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • SPENCESPENCE Posts: 204
    edited 2005-12-25 07:16
    Chris,

    don't know what has happened but all distributions by email have stoped. Maybe outgoing mail server is dead.

    This part of the program above is directly verbatim out of the book. Why the conflict?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    73
    spence
    k4kep
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-25 07:18
    I think the book was printed prior to the PBASIC 2.5 syntax and additional commands in the IDE.· If you change the labels that are keywords the code should run.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-12-25 13:40
    Yes, StampWorks 1.2 version came quite a while before the change in PBASIC (to 2.5). StampWorks 2.0 -- available now -- has been updated to be completely compatible with and take advantage of PBASIC 2.5.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • mike_smike_s Posts: 42
    edited 2005-12-25 22:27
    I wouldn't have thought you could declare lcdout as an outb data type?

    Is the syntax correct in this declaration?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-12-26 01:33
    Yes, you can alias (rename) variables using this technique.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.