Witam. Chciałbym zmierzyć czas jaki występuje pomiedzy dwoma stanami tzn. Jeżeli zasłaniam transoptor to chciałbym żeby układ zaczął liczyć czas a kończy liczyć kiedy go odsłaniam. Napisałem kod ale nie chce coś działać.
Oto ten kod:
Oto ten kod:
$regfile = "m8def.dat"
$crystal = 1000000
Config Lcd = 16 * 2
Config Lcdpin = Pin , Rs = Portb.1 , E = Portd.0 , Db7 = Portd.1 , Db6 = Portd.2 , Db5 = Portd.7 , Db4 = Portb.0
Cursor Off
Dim Wynik As Single
Config Timer1 = Timer , Edge = Rising
Do
If Pind.5 = 1 Then
Timer1 = 0
Start Timer1
Do
Loop Until Pind.5 = 0
Stop Timer1
Wynik = Timer1
Cls
Lcd Wynik ; " s"
End If
Loop