How about an external interrupt and a software counter.
[code:1:82a2b8b7dd]Dim Mycounter As Word
On Int0 Int0_isr
Enable Int0
Enable Interrupts
Do
Loop
End
Int0_isr:
If Pinx.y = 1 Then Incr Mycounter
Else Decr Mycounter
Return
[/code:1:82a2b8b7dd]
↧