beautypg.com

Rpbasic-52 programming guide – Remote Processing BASIC 52 User Manual

Page 92

background image

RPBASIC-52 PROGRAMMING GUIDE

2-73

EXAMPLE

The following example responds to an external interrupt on the RPC-330.

10 ONITR 1,1000

Declare interrupt

.

.

Other program initialization

.

200 IDLE

Wait for interrupt

210 IF F = 0 THEN 200

If not done

.

.

Program continues

.
990 END

1000 PRINT "In interrupt"

Print something

1010 C=C+1

Increment counter

1020 IF C=5 THEN F=1

Set flag on 5 times

1030 RETI