beautypg.com

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

Page 29

background image

RPBASIC-52 PROGRAMMING GUIDE

2-10

NOTE: This command takes approximately 27 ms to process. This is because the reader sends a bit of

information ev ery 1 ms. Serial a nd timing interrup ts are processed a t the hardware level. How ever,
commands such as ONTICK and ONITR are delayed until CARD$ is finished processing the data.

RELATED

C O N F I G L IN E

E R R O R

B A D A R G U M E N T When expr > 3 or negative

EXAMPLE

The follow ing exam ple reads the ca rd. CON FIG LIN E is performe d only once. T he error code is returne d in
B if no card was swiped.

CONFIG LINE 100,12,0,255,0,0

10 STRING 200,10
100 GOSUB 1000
110 IF B = 1 THEN 100
120 PRINT "Card number: ",$(0)
130 GOTO 100

1000 $(0) = CARD$(0)
1010 IF ASC($(0),1)= 45 THEN 1040

:REM See if '-'

1020 B=0
1030 RETURN
1040 B = ASC($(0),2)-48

:REM Return error number

1050 $(0)= ""
1060 RETURN