با سلا م لطفا یک نگاه به این کد بندازید ببینید مشکل کجاست
وقتی روشن می کنم رو صفحه این قسمت میاد Successful بعد هیچ تکی رو قبول نمی کنه
[code=basic]
$regfile = "m8def.dat"
$crystal = 8000000
$baud = 9600
'-------------------------------------------------------------------------------
Config Lcdpin = Pin , Rs = Portc.5 , E = Portc.4 , Db4 = Portb.4 , Db5 = Portb.3 , Db6 = Portb.2 , Db7 = Portb.1
Config Lcd = 16 * 2
'-------------------------------------------------------------------------------
Dim E As Byte
Dim P As Byte
Dim C(12) As String * 1
Dim Code As String * 10
'Dim A As String * 10
Dim B As String * 10
'Dim C As String * 11
'Dim D As String * 10
Dim N As Byte
'****************************** '
'Enable Interrupts
'Enable Urxc
'On Urxc Step1
Cursor Off
'******************************
Config Portd.2 = Output
Config Pinc.2 = Input
Config Pinc.3 = Input
'******************************
'******************************
F:
Code = "Tak Cards"
Do
'========================================= =
Cls
'******************************
Readeeprom B , 1
'******************************
If Pinc.2 = 1 Then Goto S
'******************************
If B = Code Then
Portd.2 = 1
Code = "Opened"
Locate 1 , 1
Lcd "Welcome:"
Locate 2 , 4
Lcd Code
Wait 2
Portd.2 = 0
Code = "tak Cards"
End If
'******************************
Locate 1 , 1
Lcd "<<insert Card>>"
Locate 2 , 4
Lcd Code
Waitms 600
Loop
End 'end program
'******************************
Step1:
Incr E
C(e) = Waitkey()
If E < 12 Then Goto Step1
For E = 3 To 12
Incr P
Mid(code , P , 1) = C(e)
Next
E = 0
P = 0
' Locate 2 , 1
'Lcd ; Code
'Waitms 400
'Input , Code
Return
'*****************************
S:
N = 1
Do
Cls
Locate 1 , 4
Lcd "Save user"
Locate 2 , 1
Lcd "(" ; N ; "
:" ; Code
Waitms 600
If Pinc.2 = 1 Then
Writeeeprom Code , N
Cls
Code = "Successful"
End If
'******************************
If Pinc.3 = 1 Then Goto F
'******************************
Loop
[/code]
وقتی روشن می کنم رو صفحه این قسمت میاد Successful بعد هیچ تکی رو قبول نمی کنه
[code=basic]
$regfile = "m8def.dat"
$crystal = 8000000
$baud = 9600
'-------------------------------------------------------------------------------
Config Lcdpin = Pin , Rs = Portc.5 , E = Portc.4 , Db4 = Portb.4 , Db5 = Portb.3 , Db6 = Portb.2 , Db7 = Portb.1
Config Lcd = 16 * 2
'-------------------------------------------------------------------------------
Dim E As Byte
Dim P As Byte
Dim C(12) As String * 1
Dim Code As String * 10
'Dim A As String * 10
Dim B As String * 10
'Dim C As String * 11
'Dim D As String * 10
Dim N As Byte
'****************************** '
'Enable Interrupts
'Enable Urxc
'On Urxc Step1
Cursor Off
'******************************
Config Portd.2 = Output
Config Pinc.2 = Input
Config Pinc.3 = Input
'******************************
'******************************
F:
Code = "Tak Cards"
Do
'========================================= =
Cls
'******************************
Readeeprom B , 1
'******************************
If Pinc.2 = 1 Then Goto S
'******************************
If B = Code Then
Portd.2 = 1
Code = "Opened"
Locate 1 , 1
Lcd "Welcome:"
Locate 2 , 4
Lcd Code
Wait 2
Portd.2 = 0
Code = "tak Cards"
End If
'******************************
Locate 1 , 1
Lcd "<<insert Card>>"
Locate 2 , 4
Lcd Code
Waitms 600
Loop
End 'end program
'******************************
Step1:
Incr E
C(e) = Waitkey()
If E < 12 Then Goto Step1
For E = 3 To 12
Incr P
Mid(code , P , 1) = C(e)
Next
E = 0
P = 0
' Locate 2 , 1
'Lcd ; Code
'Waitms 400
'Input , Code
Return
'*****************************
S:
N = 1
Do
Cls
Locate 1 , 4
Lcd "Save user"
Locate 2 , 1
Lcd "(" ; N ; "

Waitms 600
If Pinc.2 = 1 Then
Writeeeprom Code , N
Cls
Code = "Successful"
End If
'******************************
If Pinc.3 = 1 Then Goto F
'******************************
Loop
[/code]
دیدگاه