Just not seeing my syntax error! "Expected a Label"
I have been Googling and re-reading the manual but I just can't figure out what
stupid syntax error I have that's giving me error 148.
The subroutine label is "Fast" that gives me the error. What am I doing wrong?
Offending word in red below.
Thanks all
Jedi
Main:
FOR Clock = 0 TO 59
IF (clock = 59) THEN GOSUB Pulse ELSE GOSUB Blink
IF (clock = 0) THEN OUTH = 100111 'LED displays 0
IF (clock = 10) THEN OUTH = 000100 'LED displays 1
IF (clock = 20) THEN OUTH = 010011 'LED displays 2
IF (clock = 30) THEN OUTH = 010110 'LED displays 3
IF (clock = 40) THEN OUTH = 110100 'LED displays 4
IF (clock = 50) THEN OUTH = 110110 'LED displays 5
IF (IN6 = 1) THEN GOSUB Fast 'read Fast trigger
stupid syntax error I have that's giving me error 148.
The subroutine label is "Fast" that gives me the error. What am I doing wrong?
Offending word in red below.
Thanks all
Jedi
Main:
FOR Clock = 0 TO 59
IF (clock = 59) THEN GOSUB Pulse ELSE GOSUB Blink
IF (clock = 0) THEN OUTH = 100111 'LED displays 0
IF (clock = 10) THEN OUTH = 000100 'LED displays 1
IF (clock = 20) THEN OUTH = 010011 'LED displays 2
IF (clock = 30) THEN OUTH = 010110 'LED displays 3
IF (clock = 40) THEN OUTH = 110100 'LED displays 4
IF (clock = 50) THEN OUTH = 110110 'LED displays 5
IF (IN6 = 1) THEN GOSUB Fast 'read Fast trigger

Comments
-Phil
years in numerous languages and feel really stupid on this error - my first pBASIC project for a minute-impulse clock.
Thank you
Jedi
' {$STAMP BS2} ' {$PBASIC 2.5} ' Pin definitions: ' Pin 0 = Relay Output ' Pin 1 = LED 1Hz Blink ' Pin 2 = Fast Advance Trigger ' Initialize, declare variables, condition pins INPUT 6 Clock VAR Byte Fast VAR Byte Fast_Pulse VAR Byte OUTH = 000000 ' initialize LED output pins DIRH = 111111 ' initialize LED segments to low DO Main: FOR Clock = 0 TO 59 IF (clock = 59) THEN GOSUB Pulse ELSE GOSUB Blink IF (clock = 0) THEN OUTH = 100111 'LED displays 0 IF (clock = 10) THEN OUTH = 000100 'LED displays 1 IF (clock = 20) THEN OUTH = 010011 'LED displays 2 IF (clock = 30) THEN OUTH = 010110 'LED displays 3 IF (clock = 40) THEN OUTH = 110100 'LED displays 4 IF (clock = 50) THEN OUTH = 110110 'LED displays 5 IF (IN6 = 1) THEN GOSUB Fast 'read Fast trigger PAUSE 300 'main time variable NEXT Blink: HIGH 1 'Turn on LED PAUSE 250 '1/4 second blink LOW 1 'Turn LED off RETURN Pulse: HIGH 0 'Turn on relay PAUSE 500 'Clock advances LOW 0 'turn off relay RETURN Fast: FOR Fast_Pulse = 1 TO 60 'send 60 pulses HIGH 0 'trigger relay PAUSE 500 'clock advances LOW 0 'turn off relay NEXT RETURN LOOP ENDThat was it. Hey - I'm a little rusty
Jedi