Zdarvím, jsem začítečník, kam do programu vložit podpogram pro vynulování stopek tačítkem a jak zabezpečit aby bylo tlačítko aktivní pouze při doběhnutí stopek? Děkuji za vaše návrhy.
[code]
$regfile = M8def.dat
$crystal = 4096000
Dim _ssec As Byte
Dim _sec As Byte
Dim S_ssec As String * 2
Dim S_sec As String * 3
Dim _start_stop As Bit
Dim S As String * 5
Config Lcdpin = Pin , Db4 = Portd.7 , Db5 = Portb.0 , Db6 = Portd.5 , Db7 = Portd.6 , E = Portd.2 , Rs = Portd.0 'Konfigurace pinu* LCD
Config Pinc.3 = Input
Config Pinc.3 = Input
Config Pinc.4 = Input
Enable Interrupts
Config Timer1 = Timer , Prescale = 256
On Ovf1 Tim1_isr
Enable Timer1
Tcnt1h = 255
Tcnt1l = 96
Start Timer1
_start_stop = 0
Cls
Locate 1 , 5
Lcd “CASOMIRA”
Lowerline
Cursor Off
Wait 2
Cls
Do
Locate 1 , 6
Lcd Str(_sec)
Locate 1 , 9
Lcd “.”
Locate 1 , 10
Lcd Str(_ssec)
Locate 2 , 1
Lcd “”
Locate 2 , 1
Lcd “START STOP RESET”
Loop
Tim1_isr:
Tcnt1h = 255
Tcnt1l = 96
If Pinc.3 = 0 Then 'kdyz Je Zmacknuto Startovaci Tlacitko , Zapis 1 Na Start_stop
_start_stop = 1
End If
If Pinc.4 = 0 Then 'Jsou Spadnute Terce , Zapis 0 Na Start_stop
_start_stop = 0
End If
If _start_stop = 1 Then 'Kdyz Je _start_stop 1 Pricti 1setinu Sekundy
_ssec = _ssec + 1
End If
If _ssec >= 100 Then 'Kdyz Je 100 Setin Sekundy , Vynuluj _s_sec A Pricti 1 _sec
_ssec = 0
_sec = _sec + 1
End If
Return
End[/code]