Re: How to measure how long I pressed a button ?
you have set timer1 to overflow every 16.38 mS , you never count the overflows
also adding 65535 to a word var seems very odd do you actually intend to subtract 1
i can't see how any of this can work, i makes no sense to me
Code:
while durata < longpress
if T1CON.0 == 1 then
overflow_counter_low = overflow_counter_low + 1
if overflow_counter_low == 65535 then
overflow_counter_low = 0
durata = durata + 65535
endif
endif
durata = durata + (TMR1H * 256 + TMR1L)
wend
Warning I'm not a teacher
Bookmarks