Well, It must be obvious to one who knows this,.
Well, It must be obvious to one who knows this,.
Last edited by menta; - 22nd June 2008 at 00:19.
I tried search for "source file path exeeds 62 characters' which didn't return anything.
I guess I should have search for less words.
I have managed to use the button as interrupt form this source:
http://darreltaylor.com/DT_INTS-14/hello.html
Is it possible also to get another interrupt for the same button while it is pressed for 2 seconds for example ?
IF a timer interrupts every 1/10 second, and you want to look for a button being pressed for 2 seconds, then I'd suggest looking at the button during every interrupt and add 1 to a counter. If the counter hits 20, the button is pressed for 2 seconds. If the button is let up when the counter is below 20, then reset the counter to zero.
Simple enough...
Ye, I though about it,
But I use the button as "Rising Edge" so when the button is pressed there is no interrupt yet.
I didn't say anything about the button causing the interrupt did I?
If you re-read my post, you'll see that I said that a timer causes an interrupt and the button input is read during that interrupt. Therefore, it doesn't matter if your button pulls a line high or low, or what, as long as you are able to read the state of that pin during the interrupt.
Bookmarks