با سلام
من برنامه زیر رو دارم ولی مشکلش اینه که پسورد اول و پسورد دوم را در فلش میکرو ذخیره میکنه
برای اینکه در EEProm میکرو ذخیره بشه تا با هربار خاموش و روشن کردن دستگاه قفل رمزی آخرین پسورد تغییر یافته ذخیره شده و از بین نرود چه تغییراتی در برنامه زیر بایستی انجام شود.
اگه ممکنه تغییرات لازمه را اعمال فرمایید ممنون میشم.
من برنامه زیر رو دارم ولی مشکلش اینه که پسورد اول و پسورد دوم را در فلش میکرو ذخیره میکنه
برای اینکه در EEProm میکرو ذخیره بشه تا با هربار خاموش و روشن کردن دستگاه قفل رمزی آخرین پسورد تغییر یافته ذخیره شده و از بین نرود چه تغییراتی در برنامه زیر بایستی انجام شود.
اگه ممکنه تغییرات لازمه را اعمال فرمایید ممنون میشم.
کد:
$regfile = "M32DEF.DAT"
$crystal = 8000000
Config Kbd = Porta
Config Portb = Output
Dim B As Byte
Dim C As Byte
Dim D As Byte
Dim E As Byte
Dim F As Byte
Dim G As Byte
Dim H As Byte
Dim I As Byte
Dim J As Word
Dim L As Word
Dim M As Word
Dim N As Word
Dim P As Word
Dim Q As Word
Dim R As Word
Dim S As Word
Dim K As Byte
Dim O As Byte
Dim A As Word
Dim T As Byte
Dim X As Word
Dim Y As Word
Set Portb.2
Cursor Off
Cls
Lcd "Project Name:"
Locate 2 , 2
Lcd "*Digital Luck*"
Waitms 500
Cls
Lcd "Doen by:"
Locate 2 , 2
Lcd "M.Jafarzadegan"
Waitms 500
Cls
Lcd "Micro Controler"
Locate 2 , 4
Lcd "*Bahman 87*"
Waitms 500
L = 1234
G = 3
T = 0
O = 0
K = 2
A = 4321
Maine:
Cls
Lcd "inter password"
Cursor Blink
Y = L
Mmain:
Do
Waitms 50
B = Getkbd()
If B < 12 Then
Goto Main
End If
Loop
Main:
Do
If B = 0 Then
Reset B
C = 1
Goto Main2
End If
If B = 4 Then
Reset B
C = 2
Goto Main2
End If
If B = 8 Then
Reset B
C = 3
Goto Main2
End If
If B = 1 Then
Reset B
C = 4
Goto Main2
End If
If B = 5 Then
Reset B
C = 5
Goto Main2
End If
If B = 9 Then
Reset B
C = 6
Goto Main2
End If
If B = 2 Then
Reset B
C = 7
Goto Main2
End If
If B = 6 Then
Reset B
C = 8
Goto Main2
End If
If B = 10 Then
Reset B
C = 9
Goto Main2
End If
If B = 11 Then
Reset B
C = 12
T = 3
Goto Main2
End If
If B = 7 Then
Reset B
C = 0
Goto Main2
End If
If B = 3 Then
Reset B
C = 11
O = 3
Goto Main2
End If
Loop
Main2:
If C = 11 Then
Goto Main7
End If
If C = 12 Then
Goto Main13
End If
If G = 3 Then
Locate 2 , 1
Lcd "*"
E = C
Decr G
Goto Mmain
End If
If G = 2 Then
Locate 2 , 2
Lcd "*"
F = C
Decr G
Goto Mmain
End If
If G = 1 Then
Locate 2 , 3
Lcd "*"
H = C
Decr G
Goto Mmain
End If
If G = 0 Then
Locate 2 , 4
Lcd "*"
I = C
G = 3
End If
Main3:
M = H * 10
N = F * 100
P = E * 1000
Q = M + I
R = N + Q
S = P + R
Goto Main7
Main8:
Do
If L = A And T = 2 Then
Goto Main13
End If
If L <> S And T = 1 Then
Goto Main13
End If
If L = S Then
Reset Portb.1
Goto Main4
End If
If L <> S Then
Set Portb.1
End If
Goto Main5
Loop
Main4:
Cls
Lcd "ok"
Set Portb.0
Waitms 100
Reset Portb.0
K = 2
L = Y
Goto Maine
Main5:
Do
If K = 0 Then
Goto Main6
Else
Cls
Lcd "your try"
Locate 1 , 10
Lcd K
Locate 2 , 9
Lcd "!alarm!"
Decr K
Goto Mmain
End If
Loop
Main6:
Cls
Lcd "int master pass"
Reset L
L = A
K = 0
Goto Mmain
Main7:
Do
Main11:
If O = 3 Then
L = A
Cls
Lcd "int master pass"
Decr O
Goto Mmain
End If
If O = 2 And L = S Then
Decr O
Cls
Lcd "int new password"
Goto Mmain
End If
If O = 1 Then
L = S
Cls
Lcd L
Waitms 100
Cls
Decr O
Goto Maine
End If
If O = 0 Then
Goto Main8
End If
If O = 2 And L <> S Then
Cls
Lcd "eror"
O = 3
Waitms 100
Goto Main11
End If
Loop
Main13:
Do
Main14:
If T = 3 Then
X = L
L = A
Cls
Lcd "int master pass"
Decr T
Goto Mmain
End If
If T = 2 And A = S Then
Decr T
Cls
Lcd "new master pass"
Goto Mmain
End If
If T = 1 Then
A = S
L = X
Cls
Lcd A
Waitms 100
Cls
Decr T
Goto Maine
End If
If T = 0 Then
Goto Main8
End If
If T = 2 And A <> S Then
Cls
Lcd "eror"
T = 3
Waitms 100
Goto Main14
End If
Loop
End 'end program






دیدگاه