If you have only 1 push button, you could use an internal timer/counter. This one will increase each time you press on the switch (may need some external debouncing). You could also use an interruptible pin, says INT0, and within your ISR, you increase your counter value and process the Debouncing.
A timer interrupt, or polling a timer overflow to check the Counter value, and you're all set.
Last edited by mister_e; - 4th May 2009 at 16:59.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks