syntax error
slugmuffin
Posts: 2
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
' {$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