TIMER + button
-
- Posts: 24
- Joined: 30 Jul 2013 11:51
TIMER + button
All good morning. It is impossible to make some functions on one button being divided time. If the button is pressed less than 3 seconds, we carry out one action if the button is pressed more than 3 seconds, other action. For this purpose I use procedure Timer0Overflow_ISR (); org IVT_ADDR_TIMER0_OVF; but intervals of time aren't constant.
- marina.petrovic
- Posts: 2986
- Joined: 18 Apr 2013 08:11
Re: TIMER + button
Hi,
You can do something simple: you need to have some counter (which will count up to 3s)
and then "ask" if it is higher than 3s and execute the appropriate action.
If you want to use timer interrupts, please take a look at Timer Calculator from LibStock Website:
http://www.libstock.com/projects/view/3 ... calculator
Timer Calculator is a free software development tool used for easier calculation of timer interrupts.
Best regards,
Marina
You can do something simple: you need to have some counter (which will count up to 3s)
and then "ask" if it is higher than 3s and execute the appropriate action.
If you want to use timer interrupts, please take a look at Timer Calculator from LibStock Website:
http://www.libstock.com/projects/view/3 ... calculator
Timer Calculator is a free software development tool used for easier calculation of timer interrupts.
Best regards,
Marina
Re: TIMER + button
Perhaps the (mP and mB) library "Button_Utilities" (http://www.libstock.com/projects/view/39/utilities) can be of some help.
See http://www.rosseeld.be/DRO/PIC/Button_Utils.pdf for the documentation, see the "Timed Functionality".
The Button_Utilities library uses the "Timers" library, which you can find here: http://www.libstock.com/projects/view/103/schedulers.
See http://www.rosseeld.be/DRO/PIC/Button_Utils.pdf for the documentation, see the "Timed Functionality".
The Button_Utilities library uses the "Timers" library, which you can find here: http://www.libstock.com/projects/view/103/schedulers.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
-
- Posts: 24
- Joined: 30 Jul 2013 11:51
Re: TIMER + button
Hi!!! Timer Calculator helped me. Big ALL THANKS