?? magcard.bas
字號:
'------------------------------------------------------------------
' MAGCARD.BAS
' (c) 2000 MCS Electronics
'------------------------------------------------------------------
'[DIM used variables]
Dim X(40) As Byte , I As Byte , Bts As Byte , Dum As Byte
'[ALIAS the pins used]
_mcs Alias P1.1
_mclock Alias P1.2
_mdata Alias P1.0
Do
I = Inkey() 'get a key
If I = "L" Then 'learn mode
Print "Learning"
Print "Slide magcard through reader"
Readmagcard X(1) , Bts , 5 , 100000 'call routine
' ^ may be 5 or 7. 7 bit coding not implemented yet
' ^-- time out value sets ERR when time out occurs
For I = 1 To Bts
Writeeeprom X(i) , I
Next
Print "Stored"
Else
Print "Slide magcard through reader"
Readmagcard X(1) , Bts , 5 , 100000 'call routine
' ^ may be 5 or 7. 7 bit coding not implemented yet
' ^-- time out value sets ERR when time out occurs
Print "Error " ; Err '1 if error occured
Print ; " " ; Bts ; " bytes read" 'show number of bytes read
For I = 1 To Bts
Print X(i) ; " ";
Next
Print 'show number
Err = 0
For I = 1 To Bts
Readeeprom Dum , I
'Print "eprom " ; Dum ; " mag " ; X(i) ;
If Dum <> X(i) Then
Err = 1
' Print "Error at " ; I
End If
Next
If Err = 0 And Bts = 34 Then
Print "Valid card"
Else
Print "Invalid card"
End If
End If
Print
Loop
End
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -