Shop OBEX P1 Docs P2 Docs Learn Events
syntax error — Parallax Forums

syntax error

slugmuffinslugmuffin Posts: 2
edited 2014-04-27 12:01 in BASIC Stamp
This is my first Basic progran and I can't get past this syntax error. It points to the DO command and says missing ':'

' {$STAMP BS1}
' {$PBASIC 1.0}
OUTPUT 0 ' Open Motor
OUTPUT 1 ' Close Valve
OUTPUT 2 ' Door is open
OUTPUT 3 ' No power from power supply INPUT 5
INPUT 4 ' Input pulse from Garage Door Opener
INPUT 5 ' Door fully open switch
INPUT 6 ' Close door if open, keep it closed
INPUT 7 ' No power from power supply

HIGH 1
HIGH 2
HIGH 3
HIGH 4
SYMBOL MOTOR = PIN0
SYMBOL CLOSE_VALVE = PIN1
SYMBOL DOOR_OPEN = PIN2
SYMBOL POWER_SUPPLY = PIN3
SYMBOL OPENER_PULSE = PIN4
SYMBOL DOOR_OPEN_SWITCH = PIN5
SYMBOL EXTERNAL_CLOSE_DOOR = PIN6
SYMBOL BATTERY_CHARGER = PIN7
SYMBOL ON = 1
SYMBOL OFF = 0
' Door Controller
' This program will receive a pulse from the garage door opener.
' If door is open it will close and visa versa. If door is neither open or close it
' will stop the motor.
' Open is determined by the open switch. Closed is determine by a timeout period of the
' close valve being open.
Begin:
DO <-- Syntax error: Missing ':'
IF PIN4 = ON THEN
OpenCloseDoor ' Open and close door routine

LOOP
OpenCloseDoor:
DEBUG "PULSE!", CR
PAUSE 2000
GOTO Begin

Comments

  • SapphireSapphire Posts: 496
    edited 2014-04-27 11:15
    The DO ... LOOP command is not available in the BS1. You will have to create your own loop with a GOTO statement instead.
    Begin:
    IF PIN4 = ON THEN OpenCloseDoor
    GOTO Begin
    
  • slugmuffinslugmuffin Posts: 2
    edited 2014-04-27 12:01
    Thank you .....
Sign In or Register to comment.