Goto Loop causes your program to run in a continuous loop.
This line; HSerin 2000,APRI,[WAIT ("*ELIP:")] will WAIT for 2 seconds,
then jump to the APRI sub-routine if ASCII chars *ELIP: are not received
within the timeout period.
Execution will also "fall-through" to APRI even if these characters "are"
received - so you have a continuous loop no matter what happens.
If you prefer to only enter the APRI sub-routine once these characters
are received, then change the timeout "label" from APRI to Loop.
Code:
INIT:
Pause 2000
LOOP:
Pause 500
HSerout ["AT*EIPS=1,1",13]
Pause 500
HSerin 2000,LOOP,[WAIT ("*ELIP:")]
APRI: ' Land here only when characters are received.
High PORTB.4
Pause 1000
Low PORTB.4
Pause 15000
Goto LOOP
Or or use a local label something like this;
Code:
INIT:
Pause 2000
LOOP:
Pause 500
HSerout ["AT*EIPS=1,1",13]
Pause 500
Loop2: ' Loop to here until characters are received
HSerin 2000,Loop2,[WAIT ("*ELIP:")]
APRI:
High PORTB.4
Pause 1000
Low PORTB.4
Pause 15000
Goto LOOP
Bookmarks