با سلام
من یک برنامه نوشتم مال در بازکن تلفنی میخواستم ببینم درست نوشتمش اینم برنامه
:read: :cry2: :angry: :nerd: :job:
:agree: :agree:
من یک برنامه نوشتم مال در بازکن تلفنی میخواستم ببینم درست نوشتمش اینم برنامه
کد:
$regfile = "m8def.dat" $crystal = 8000000 '$baud = 9600 Config Portd = Input Config Portb.7 = Input Config Portb.6 = Output Config Portc.5 = Output Config Portc.4 = Output Config Portc.3 = Output Config Debounce = 50 Config Lcdpin = Pin , Db4 = Portb.3 , Db5 = Portb.4 , Db6 = Portb.5 , Db7 = _ Portc.0 , E = Portb.2 , Rs = Portb.1 Config Lcd = 16 * 2 Cursor Off Cls Declare Sub Main Dim D As Long , Seco As Byte , A As Byte , B As Byte , C As String * 8 , F As Long Dim E As Eram Long Sina: Delay Home Lcd " Waiting" Wait 1 Do If Pinb.7 = 1 Then Jmp Q Loop Q: Cls Home L Lcd " javab" Waitms 50 Set Portb.6 Cls If E = &HFFFFFFFF Then jmp Here Else jmp Sh End If Here: E = 123456 Sh: Cls : Home : Lcd "PASSWORD ENTER=#" B = 0 : C = "" : Locate 2 , 1 Call Main If E = D Then If Pind = &B00001010 Then Goto Bb Else Jmp Control End If Else Cls : Home Lcd "Wrong Password" Reset Portb.6 Wait 2 : Cls : Home : Jmp Sina End If Bb: Cls : Cursor Off : Home Lcd "1:Change Pass" Locate 2 , 1 : Lcd "2:Back" Bc: A = Pind If Seco <= 60 And A > &B00001100 Then Reset Portb.6 Goto Sina '-------------------------- A = Lookup(a , Jadval) If A = 49 Then Jmp Change If A = 50 Then Jmp Sh jmp Bc Change: Cls : Cursor Off : Home Lcd "Type Old Pass" Locate 2 , 1 Call Main If E = D Then jmp Gh Else Cls : Home : Lcd "Wrong Pass" : Wait 2 Reset Portb.6 jmp sina End If Gh: Cls : Cursor Off : Home Lcd "Type New Pass" Locate 2 , 1 Call Main E = D jmp Bb End Control: Cls Home Lcd " wellcome" Wait 3 Cls 000: Do If Seco <= 60 And Pind < &B00001100 Then jmp klid Else Reset Portb.6 jmp sina End If Klid: If Pind = &B00000001 Then Goto Relay1 If Pind = &B00000010 Then Goto Relay2 If Pind = &B00000011 Then Goto Relay3 If Pind = &B00000100 Then Goto Relay1_off If Pind = &B00000101 Then Goto Relay2_off If Pind = &B00000110 Then Goto Relay3_off If Pind = &B00001001 Then Goto Int_off Loop ' LABEL LABEL LABEL LABEL LABEL LABEL LABEL LABEL LABEL LABEL LABEL LABELLABEL '**************************************TV*************************************** Int_off: Waitms 10 Reset Portb.6 Waitms 10 jmp sina Relay1: Cls Set Portc.5 If Portc.5 = 1 Then Locate 1 , 4 Lcd "Relay1 on" End If Waitms 100 jmp 0000 Relay1_off: Cls Reset Portc.5 If Portc.5 = 1 Then Locate 1 , 4 Lcd "Relay1 off" End If Waitms 100 jmp 0000 '***************************************WASHER********************************** Relay2: Cls Set Portc.4 If Portc.4 = 1 Then Locate 1 , 3 Lcd "Relay2" End If Waitms 100 jmp 0000 Relay2_off: Cls Reset Portc.4 If Portc.4 = 1 Then Locate 1 , 3 Lcd "Relay2 Off" End If Waitms 100 jmp 0000 '**************************************FAN************************************** Relay3: Cls Set Portc.3 If Portc.3 = 1 Then Locate 1 , 3 Lcd "Relay3 ON" End If Waitms 100 jmp 0000 Relay3_off: Cls Reset Portc.3 If Portc.3 = 1 Then Locate 1 , 3 Lcd "Relay3 Off" End If Waitms 100 jmp 0000 End 'end program '----------------------------------------------------------- Main: B = 0 : C = "" Aa: A = Pind If Seco <= 60 And A > &B00001100 Then Reset Portb.6 Goto Sina A = Lookup(a , Jadval) Select Case A '---------------------- Case 48 To 57: If B < &B00001000 Then Incr B Lcd String(1 , A) C = C + String(1 , A) End If jmp Aa '---------------------- Case 35: D = Val(c) End Select Return '-------------------------------------------------- Jadval: Data 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 42 , 35

دیدگاه