ادامه کد ساعت بالا
وقتی یه نفر تشکر میکنه آدم خستگیش در میره دمتون گرم هرچی خواستید بگید من میزارم ولی خیلی سخت نباشه چون نمیتونم چیزی رو ازنو بنویسم ولی اگه قبلا انجامش داده باشم میزارم رو تخم چشام
oo:
کد:
Ss1:
Waitms T1
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Ssal
Debounce Pind.1 , 1 , Ss8
Debounce Pind.2 , 1 , Ss9
Loop
' DESINGED BY A.N.T
Ss9:
Timer2 = 0: Stimer = 0: Ss = 0: Locate 1, 7: Lcd "00": GoTo Ss1
Ss8:
Timer2 = 0: Stimer = 0
If Ss > 29 Then Mm = Mm + 1
If Mm > 59 Then
Mm = 0: Cc = Cc + 1: Ecc = Cc
If Cc > 23 Then
Cc = 0: Roz = Roz + 1: Hafteh = Hafteh + 1
If Hafteh > 7 Then Hafteh = 1
If Mah > 6 Then
If Roz > 30 Then
Roz = 1: Mah = Mah + 1
If Mah > 12 Then
Mah = 1: Sal = Sal + 1
If Sal > 99 Then Sal = 0
If Sal < 10 Then : Home L : Lcd " " ; Sal ; "/"
Else: Home L: Lcd Sal
End If
Esal = Sal
End If
If Mah < 10 Then : Locate 2 , 4 : Lcd "0" ; Mah ; "/"
Else: Locate 2, 4: Lcd Mah
End If
Emah = Mah
End If
ElseIf 7 > Mah Then:
If Roz > 31 Then
Roz = 1: Mah = Mah + 1
If Mah > 12 Then
Mah = 1: Sal = Sal + 1
If Sal < 10 Then : Home L : Lcd " " ; Sal ; "/"
Else : Home L : Lcd Sal ; "/"
End If
Esal = Sal
End If
If Mah < 10 Then : Locate 2 , 4 : Lcd "0" ; Mah ; "/"
Else: Locate 2, 4: Lcd Mah
End If
Emah = Mah
End If
Eroz = Roz: Ehafteh = Hafteh
End If
Locate 2, 9
Select Case Hafteh
Case 1: Lcd " SAT"
Case 2: Lcd " SUN"
Case 3: Lcd " MON"
Case 4: Lcd " TUE"
Case 5: Lcd " WED"
Case 6: Lcd " THU"
Case 7: Lcd " FRI"
End Select
Locate 2, 7
If Roz < 10 Then : Lcd "0" ; Roz
Else: Lcd Roz
End If
End If
If Cc < 10 Then : Home : Lcd " " ; Cc ; ":"
Else : Home : Lcd Cc ; ":"
End If
Ecc = Cc
End If
Locate 1, 4
If Mm < 10 Then : Lcd "0" ; Mm ; "/00"
Else : Lcd Mm ; "/00"
End If
Ss = 0: GoTo Ss1
Return
' BARAT TANZIM SA@ TIMER
Ct:
F = 4
For W = 0 To 40000
If Pind.0 = 0 Then : Goto Ct1 : End If
Waitus 60
Debounce Pind.3 , 1 , D7 , Sub
Next
GoTo Cc
Ct1:
Waitms T1 : Z = 10 : Reset Portb.3
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Mt
Debounce Pind.1 , 1 , Ct8
Debounce Pind.2 , 1 , Ct9
Loop
Ct8:
Ct = Ct + 1: If Ct > 23 Then Ct = 0: GoTo Ct1
Ct9:
Ct = Ct - 1: If Ct > 200 Then Ct = 23: GoTo Ct1
Return
' BARAT TANZIM DAGHIGHEH TIMER
Mt:
Ect = Ct: F = 5: Locate 1, 12: Z = 10
If Ct < 10 Then : Lcd " " ; Ct ; ":"
Else : Lcd Ct ; ":"
End If
Mt1:
Waitms T1
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Mt2
Debounce Pind.1 , 1 , Mt8
Debounce Pind.2 , 1 , Mt9
Loop
Mt8:
Mt = Mt + 1: If Mt > 59 Then Mt = 0: GoTo Mt1
Mt9:
Mt = Mt - 1: If Mt > 200 Then Mt = 59: GoTo Mt1
Mt2:
Emt = Mt: Locate 1, 15
If Mt < 10 Then : Lcd "0" ; Mt
Else: Lcd Mt
End If
Z = 0 : If B = 1 Then Set Portb.3 : Goto Star
Return
' BARAY FAAL VA GHER FAAL KARDAN TIMER
D7:
Locate 1, 10
If B = 0 Then : B = 1 : Lcd Chr(1) : Set Portb.3
Elseif B = 1 Then : B = 0 : Lcd " " : Reset Portb.3
Else : B = 1 : Lcd Chr(1) : Set Portb.3
End If
Eb = B : Locate 2 , 20 : Reset Portd.7 : Z = 0
Reset Portd.5 : Reset Portd.6 : If Kk = 1 Then Goto Star
Waitms T1
Return
Return
' BARAY TANZIM TARIKH SAL
Ssal:
F = 6: Locate 1, 7
If Ss < 10 Then : Lcd "0" ; Ss
Else: Lcd Ss
End If
Ssal1:
Waitms T1
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Mmah
Debounce Pind.1 , 1 , Ssal8
Debounce Pind.2 , 1 , Ssal9
Loop
Ssal8:
Sal = Sal + 1: If Sal > 99 Then Sal = 0: GoTo Ssal1
Ssal9:
Sal = Sal - 1: If Sal > 200 Then Sal = 99: GoTo Ssal1
Return
' BARAY TANZIM TARIKH MAH
Mmah:
F = 7: Esal = Sal: Home L
If 10 > Sal Then : Lcd " " ; Sal ; "/"
Else : Lcd Sal ; "/"
End If
Mmah1:
Waitms T1
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Rroz
Debounce Pind.1 , 1 , Mmah8:
Debounce Pind.2 , 1 , Mmah9
Loop
Mmah8:
Mah = Mah + 1: If Mah > 12 Then Mah = 1: GoTo Mmah1
Mmah9:
Mah = Mah - 1: If Mah = 0 Then Mah = 12: GoTo Mmah1
Return
' BARAY TANZIM TARIKH ROZ
Rroz:
F = 8: Emah = Mah: Locate 2, 4
If 10 > Mah Then : Lcd "0" ; Mah ; "/"
Else : Lcd Mah ; "/"
End If
Rroz1:
Waitms T1
Select Case Mah:
Case Is > 6:
If Roz > 30 Then: Roz = 1
ElseIf Roz = 0 Then: Roz = 30
End If
Case Is < 7:
If Roz > 31 Then: Roz = 1
ElseIf Roz = 0 Then: Roz = 31
End If
End Select
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Hhafteh
Debounce Pind.1 , 1 , Rroz8
Debounce Pind.2 , 1 , Rroz9
Loop
Rroz8:
Roz = Roz + 1: GoTo Rroz1
Rroz9:
Roz = Roz - 1: GoTo Rroz1
Return
' BARAY TANZIM ROOZ HAFTEH
Hhafteh:
F = 9: Eroz = Roz: Locate 2, 7
If Roz < 10 Then : Lcd "0" ; Roz
Else: Lcd Roz
End If
Hhafteh1:
Waitms T1
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Hhafteh2
Debounce Pind.1 , 1 , Hhafteh8
Debounce Pind.2 , 1 , Hhafteh9
Loop
Hhafteh8:
Hafteh = Hafteh + 1: If Hafteh > 7 Then Hafteh = 1: GoTo Hhafteh1
Hhafteh9:
Hafteh = Hafteh - 1: If Hafteh = 0 Then Hafteh = 7: GoTo Hhafteh1
Hhafteh2:
Ehafteh = Hafteh: Locate 2, 9
Select Case Hafteh:
Case 1: Lcd " SAT"
Case 2: Lcd " SUN"
Case 3: Lcd " MON"
Case 4: Lcd " TUE"
Case 5: Lcd " WED"
Case 6: Lcd " THU"
Case 7: Lcd " FRI"
End Select
GoTo Star
Return
' BARAY TANZIM DAMAY BALA
Dama1:
F = 11
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Dama2
If Pind.1 = 0 Then :
If Pind.2 = 0 Then Exit Do
End If
Loop
Dama15:
Waitms T1
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Dama2
Debounce Pind.1 , 1 , Dama18
Debounce Pind.2 , 1 , Dama19
Loop
Dama18:
Cup = Cup + 1: If Cup > 99 Then Cup = 0: GoTo Dama15
Dama19:
Cup = Cup - 1: If Cup > 200 Then Cup = 99: GoTo Dama15
Return
' BARAY TANZIM DAMAY PAEEN
Dama2:
F = 12: Waitms T1
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Dama22
Debounce Pind.1 , 1 , Dama28
Debounce Pind.2 , 1 , Dama29
Loop
Dama28:
Cdown = Cdown + 1: If Cdown > 99 Then Cdown = 0: GoTo Dama2
Dama29:
Cdown = Cdown - 1: If Cdown > 200 Then Cdown = 99: GoTo Dama2
Dama22:
Ecdown = Cdown: Ecup = Cup: Locate 2, 13
If A0 < 10 Then : Lcd " " ; A0 ; Chr(0)
ElseIf A0 > 99 Then: Lcd " ERR"
Else : Lcd " " ; A0 ; Chr(0)
End If
GoTo Star
Return
' BARAY TANZIM ZAMAN T1
Tt1:
F = 21: Waitms T1: Kk = 0
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Tt13
Debounce Pind.1 , 1 , Tt11
Debounce Pind.2 , 1 , Tt12
Loop
Tt11:
Tt1 = Tt1 + 1: If Tt1 > 15 Then Tt1 = 0: GoTo Tt1
Tt12:
Tt1 = Tt1 - 1: If Tt1 = 255 Then Tt1 = 15: GoTo Tt1
Tt13:
Ett1 = Tt1: GoTo Tt2
Return
' BARAY TANZIM ZAMAN T2
Tt2:
F = 22: Waitms T1
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Tt23
Debounce Pind.1 , 1 , Tt21
Debounce Pind.2 , 1 , Tt22
Loop
Tt21:
Tt2 = Tt2 + 1: If Tt2 > 15 Then Tt2 = 0: GoTo Tt2
Tt22:
Tt2 = Tt2 - 1: If Tt2 = 255 Then Tt2 = 15: GoTo Tt2
Tt23:
Ett2 = Tt2: GoTo Tt3
Return
' BARAY TANZIM ZAMAN T3
Tt3:
F = 23: Waitms T1
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Tt33
Debounce Pind.1 , 1 , Tt31
Debounce Pind.2 , 1 , Tt32
Loop
Tt31:
Tt3 = Tt3 + 1: If Tt3 > 15 Then Tt3 = 0: GoTo Tt3
Tt32:
Tt3 = Tt3 - 1: If Tt3 = 255 Then Tt3 = 15: GoTo Tt3
Tt33:
Ett3 = Tt3: GoTo Tt4
Return
' BARAY TANZIM ZAMAN T4
Tt4:
F = 24: Waitms T1
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Tt43
Debounce Pind.1 , 1 , Tt41
Debounce Pind.2 , 1 , Tt42
Loop
Tt41:
Tt4 = Tt4 + 1: If Tt4 > 15 Then Tt4 = 0: GoTo Tt4
Tt42:
Tt4 = Tt4 - 1: If Tt4 = 255 Then Tt4 = 15: GoTo Tt4
Tt43:
Ett4 = Tt4: GoTo Tt5
Return
' BARAY TANZIM ZAMAN T5
Tt5:
F = 25: Waitms T1
Do
Debounce Pind.3 , 1 , D7 , Sub
Debounce Pind.0 , 1 , Tt53
Debounce Pind.1 , 1 , Tt51
Debounce Pind.2 , 1 , Tt52
Loop
Tt51:
Tt5 = Tt5 + 1: If Tt5 > 15 Then Tt5 = 0: GoTo Tt5
Tt52:
Tt5 = Tt5 - 1: If Tt5 = 255 Then Tt5 = 15: GoTo Tt5
Tt53:
F = 0: Ett5 = Tt5: Locate 1, 12:
If Ct < 10 Then : Lcd " " ; Ct
Else: Lcd Ct
End If
Lcd ":": Locate 1, 15:
If Mt < 10 Then : Lcd "0" ; Mt
Else: Lcd Mt
End If
GoTo Star
Return
' BARAY KHAMOSH KARDAN ETELAAT LCD DAR ZAMAN CHESHMAK ZADAN HENGAM ENTEKHAB GOZINEH MARBOTEH
Offlcd:
If F <> 0 Then:
If F = 1 Then: Home: Lcd " "
ElseIf F = 2 Then: Locate 1, 4: Lcd " "
Else:
If F = 3 Then: Locate 1, 7: Lcd " "
ElseIf F = 4 Then: Locate 1, 12: Lcd " "
End If
End If
If F = 5 Then: Locate 1, 15: Lcd " "
ElseIf F = 6 Then: Locate 2, 1: Lcd " "
Else:
If F = 7 Then: Locate 2, 4: Lcd " "
ElseIf F = 8 Then: Locate 2, 7: Lcd " "
End If
End If
If F = 9 Then: Locate 2, 9: Lcd " "
ElseIf F = 25 Then: Locate 1, 15: Lcd " "
Else:
If F = 11 Then : Locate 2 , 13 : Lcd " " ; Chr(2)
Elseif F = 12 Then : Locate 2 , 13 : Lcd " " ; Chr(3)
End If
End If
' DESINGED BY A.N.T
If F = 21 Then: Locate 1, 15: Lcd " "
ElseIf F = 22 Then: Locate 1, 15: Lcd " "
Else:
If F = 23 Then: Locate 1, 15: Lcd " "
ElseIf F = 24 Then: Locate 1, 15: Lcd " "
End If
End If
End If
Return
' BARAY NAMAYESH ETELAAT MORED NIYAZ DAR ZAMAN MONASEB BAR ROY LCD
Onlcd:
If F <> 0 Then:
Home
If Cc < 10 Then : Lcd " " ; Cc
Else: Lcd Cc
End If
Locate 1, 4
If Mm < 10 Then : Lcd "0" ; Mm
Else: Lcd Mm
End If
Locate 1, 7
If Ss < 10 Then : Lcd "0" ; Ss
Else: Lcd Ss
End If
Home L
If Sal < 10 Then : Lcd " " ; Sal
Else: Home L: Lcd Sal
End If
If F = 5 Then
Locate 1, 15:
If Mt < 10 Then : Lcd "0" ; Mt
Else: Lcd Mt
End If
ElseIf F = 4 Then
Locate 1, 12:
If Ct < 10 Then : Lcd " " ; Ct
Else: Lcd Ct
End If
End If
Locate 2, 4
If Mah < 10 Then : Lcd "0" ; Mah
Else: Lcd Mah
End If
Locate 2, 7
If Roz < 10 Then : Lcd "0" ; Roz
Else: Lcd Roz
End If
Locate 2, 9
Select Case Hafteh
Case 1: Lcd " SAT"
Case 2: Lcd " SUN"
Case 3: Lcd " MON"
Case 4: Lcd " TUE"
Case 5: Lcd " WED"
Case 6: Lcd " THU"
Case 7: Lcd " FRI"
End Select
If F = 25 Then
Locate 1, 12:: Lcd "T5="
If Tt5 < 10 Then : Lcd "0" ; Tt5
Else: Lcd Tt5
End If
End If
If F = 11 Then
Locate 2, 14
If Cup < 10 Then : Lcd "0" ; Cup
Else: Lcd Cup
End If
ElseIf F = 12 Then:
Locate 2, 14
If Cdown < 10 Then : Lcd "0" ; Cdown
Else: Lcd Cdown
End If
End If
If F = 21 Then
Locate 1, 12: Lcd "T1="
If Tt1 < 10 Then : Lcd "0" ; Tt1
Else: Lcd Tt1
End If
ElseIf F = 22 Then
Locate 1, 12:: Lcd "T2="
If Tt2 < 10 Then : Lcd "0" ; Tt2
Else: Lcd Tt2
End If
End If
If F = 23 Then
Locate 1, 12: Lcd "T3="
If Tt3 < 10 Then : Lcd "0" ; Tt3
Else: Lcd Tt3
End If
ElseIf F = 24 Then
Locate 1, 12:: Lcd "T4="
If Tt4 < 10 Then : Lcd "0" ; Tt4
Else: Lcd Tt4
End If
End If
End If
Return
' DESINGED BY A.N.T
End
oo:













دیدگاه