Celem jest pomiar prędkosci obrotowej. Program się kompiluje, ale wyświetla cały czas 0.0 rpm. Nie wiem gdzie tkwi błąd, czy ktoś może mi pomóc?
$regfile = "m8def.dat"
$crystal = 8000000
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0 , E = Portc.4 , Rs = Portc.5
Config Timer1 = Timer , Prescale = 8 , Capture Edge = Rising
Config Int0 = Rising
Dim Wynik As Single
Dim Zmienna As Single
Enable Interrupts
Enable Timer1
Enable Int0
On Int0 Przerwanie
Do
cls
Lcd "obrotomierz"
Lowerline
Lcd Wynik ; " rpm"
Loop
End
Przerwanie:
Stop Timer1
Zmienna = Timer1
Wynik = 60000000 / Zmienna
Start Timer1
Return
