Error defining SYMBOL in PBasic
Michael3079
Posts: 3
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.
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
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
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.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering