Shop OBEX P1 Docs P2 Docs Learn Events
Error defining SYMBOL in PBasic — Parallax Forums

Error defining SYMBOL in PBasic

Michael3079Michael3079 Posts: 3
edited 2009-01-02 20:14 in BASIC Stamp
I am getting an error when running the following code in PBasic (Version 2.4.2).
The error is "Label is missing ":" as if looking for a label.
I don't understand why this is not valid code.

' {$STAMP BS2p}
' {$PBASIC 2.5}
········ ' Program Listing For Interfacing To DS1620 Digital Thermometer
' Program: DS1620.BAS
' This program interfaces the DS1620 Digital Thermometer to the
' BASIC Stamp. Input and output subroutines can be combined to
' set the '1620 for thermometer or thermostat operation, read
' or write nonvolatile temperature setpoints and configuration
' data.
' ===================== Define Pins and Variables ================
SYMBOL DQp = pin2 ' Data I/O pin.· ERROR: "Label is missing ":"

SYMBOL DQn = 2 ' Data I/O pin _number_.
SYMBOL CLKn = 1 ' Clock pin number.
SYMBOL RSTn = 0 ' Reset pin number.
SYMBOL DSout = W0 ' Use bit-addressable byte for DS1620 output.
SYMBOL DSin = W0 ' " " " word " " input.
SYMBOL clocks = B2 ' Counter for clock pulses.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-01 18:19
    The SYMBOL statement is only used for programming the BS1. Look in the manual or help file for the CON and VAR statements which are used for BS2 programs.

    It looks like you're using a sample program for the BS1 and DS1620. Switch to the sample program for the BS2 further on in the application note.

    Post Edited (Mike Green) : 1/1/2009 6:24:18 PM GMT
  • MovieMakerMovieMaker Posts: 502
    edited 2009-01-01 18:22
    TRY:

    SYMBOL_DQn PIN 2 ' Data I/O pin _number_.
    SYMBOL_CLKn PIN 1 ' Clock pin number.
    SYMBOL_RSTn PIN 0 ' Reset pin number.
    SYMBOL_DSout PIN W0 ' Use bit-addressable byte for DS1620 output.
    SYMBOL_DSin PIN W0 ' " " " word " " input.
    SYMBOL_clocks PIN B2 ' Counter for clock pulses.




    smile.gif
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-01-02 20:14
    It is always a good idea to use an alias for a variable rather than specifying the register name directly. While PIN would be used for assigning I/O pins, VAR is used to declare variables.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
Sign In or Register to comment.