I'm trying to put together a system that uses two buttons for input. When button a is pressed it does one action, when button b is pressed it does another action and when both buttons are pressed it does a third action. I have this much working. What I'd like to do is to be able to hold both buttons down and depending on how long they were held do different actions. For instance if they are held for more than 1 sec but less than 3 secs it should do one action. If they're both held for more than 3 but less than 5 it should do another action. I can make this work also. Where I run in to trouble is that I'd like to have feedback at the 1, 3 and 5 second intervals like an LED flashing to let the user know how long they've held the buttons.
Right now I'm using 2 interrupts to monitor the buttons. Right now it's on the button release that I'm checking to see whether both buttons were pressed at the same time and how long they were held for. I'm thinking maybe to check this when they're pressed somehow and starting an interrupt timer when they're pressed that will flash the LED at the 1, 3 and 5 second intervals and keep track of which action should be done on release. Is there an obvious easier way that I'm missing?
Thanks!