Witam. od razu zaznaczam , że jestem początkujący w pisaniu programów.
Problem mam taki , że chciałem się nauczyć robić menu, ale nie dość, że ono nie działa to cały program też oprócz tego że na wyświetlaczu pojawia się ta liczba 100 czyli T i drugie 100 czyli S.
Program ma polegać na tym by zwiększać i zmniejszać T, a po przejścu do menu1 robić to samo z S.
Oto kod:
Problem mam taki , że chciałem się nauczyć robić menu, ale nie dość, że ono nie działa to cały program też oprócz tego że na wyświetlaczu pojawia się ta liczba 100 czyli T i drugie 100 czyli S.
Program ma polegać na tym by zwiększać i zmniejszać T, a po przejścu do menu1 robić to samo z S.
Oto kod:
$regfile "m8def.dat"
$crystal = 8000000
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portd.5 , Db5 = Portd.6 , Db6 = Portd.7 , Db7 = Portd.4 , E = Portd.3 , Rs = Portd.2
Config Portb.4 = Input
Config Portb.5 = Input
Config Portb.3 = Input
Set Portb.4
Set Portb.5
Set Portb.3
Dol Alias Portb.4
Gora Alias Portb.5
Ok Alias Portb.3
Dim T As Byte
Dim S As Byte
T = 100
S = 100
Cls
Lcd ; T
Lowerline
Lcd ; S
Waitms 100
Declare Sub Menu
Declare Sub Menu1
Do
Menu:
If Gora = 0 Then
Waitms 150
If Gora = 0 Then
T = T + 2
If T > 140 Then T = 140
End If
End If
If Dol = 0 Then
Waitms 150
If Dol = 0 Then
T = T - 2
If T < 1 Then T = 2
End If
End If
If Ok = 0 Then
Waitms 150
If Ok = 0 Then
Goto Menu1
End If
End If
Loop
Menu1:
If Gora = 0 Then
Waitms 150
If Gora = 0 Then
S = S + 2
End If
End If
If Dol = 0 Then
Waitms 150
If Dol = 0 Then
S = S - 2
End If
End If
If Ok = 0 Then
Waitms 150
If Ok = 0 Then
Goto Menu
End If
End If
Return