Hi. I have a project which I will need to detect both high and low changes. Furthermore, I will need to detect the length of time which the button is held high or low; i.e. if button is pressed and hold within 2 seconds do task1; else if button is press and hold for more than 2 seconds do task2.
I have tried using PIC16 interrupt on change and set it up to detect both high and low edge change. This gave me intermittent detection result.
However, if use interrupt on change only on HI or LO detect then how can I detect the other edge change?
The challenge for me here is to do the proper edge detection. I can use a simple delay or Timer roll-over to debounce. Once I am certain of the "edge", the task1 or task2 is simple.
Please advise.
Thanks.
I have tried using PIC16 interrupt on change and set it up to detect both high and low edge change. This gave me intermittent detection result.
However, if use interrupt on change only on HI or LO detect then how can I detect the other edge change?
The challenge for me here is to do the proper edge detection. I can use a simple delay or Timer roll-over to debounce. Once I am certain of the "edge", the task1 or task2 is simple.
Please advise.
Thanks.