Tu je kúsok ešte nedokončeného kódu.
Kód: Vybrať všetko
'-------------------Nastavenie Datum Cas-----------------------------------------------
Nast_dat_cas:
Cls
Menu_level = 2
St_menu = 0
Gosub Read1307time
Lcdat 1 , 24 , "Datum/Cas:"
Lcdat 3 , 1 , S_hours ; ":" ; S_minutes
Lcdat 4 , 1 , S_day ; "." ; S_month ; ".2" ; S_year ; " "
Lcdat 5 , 1 , "Exit"
Lcdat 6 , 1 , "Ulozit"
Lcdat 8 , 1 , "Enter" , 1
Set_dat_cas:
Do
Gosub Stringformat
Select Case St_menu
Case 0 : Lcdat 3 , 1 , S_hours , 1
Lcdat 6 , 1 , "Ulozit"
Lcdat 8 , 80 , "Scroll" , 1
Case 1 : Lcdat 3 , 26 , S_minutes , 1
Lcdat 3 , 1 , S_hours
Lcdat 8 , 80 , "Scroll" , 1
Case 2 : Lcdat 4 , 1 , S_day , 1
Lcdat 3 , 26 , S_minutes
Lcdat 8 , 80 , "Scroll" , 1
Case 3 : Lcdat 4 , 25 , S_month , 1
Lcdat 4 , 1 , S_day
Lcdat 8 , 80 , "Scroll" , 1
Case 4 : Lcdat 4 , 50 , "2" ; S_year , 1
Lcdat 4 , 25 , S_month
Lcdat 8 , 80 , "Scroll" , 1
Case 5 : Lcdat 5 , 1 , "Exit" , 1
Lcdat 4 , 50 , "2" ; S_year
Lcdat 8 , 80 , "Scroll" , 1
Case 6 : Lcdat 6 , 1 , "Ulozit" , 1
Lcdat 5 , 1 , "Exit"
Lcdat 8 , 80 , "Scroll" , 1
End Select
Debounce Forward_tl , 0 , Forward , Sub
Debounce Enter_tl , 0 , Enter_dat_cas , Sub
Loop
Return
Return
Enter_dat_cas:
If St_menu = 5 And Menu_level = 2 Then
Call Nastavenie
End If
Do
Lcdat 8 , 80 , " "
Lcdat 8 , 120 , Chr(94) , 1
Debounce Enter_tl , 0 , Set_dat_cas:
Debounce Forward_tl , 0 , Forward_dat__cas , Sub
Loop
Return
Forward_dat__cas:
If St_menu = 0 Then
Incr Hours
If Hours > 24 Then Hours = 0
Gosub Stringformat
Lcdat 3 , 1 , S_hours , 1
End If
If St_menu = 1 Then
Incr Minutes
If Minutes > 60 Then Minutes = 0
Gosub Stringformat
Lcdat 3 , 26 , S_minutes , 1
End If
If St_menu = 2 Then
Incr Day
If Day > 31 Then Day = 1
Gosub Stringformat
Lcdat 4 , 1 , S_day , 1
End If
If St_menu = 3 Then
Incr Month
If Month > 12 Then Month = 1
Gosub Stringformat
Lcdat 4 , 1 , S_month , 1
End If
Return