I´m making a memory gam with 8 button and a need a help how to make a C program in CCS COMPILER
for to make such task :
- if the button D1 is pressed Hold during 3 seconds turn ON the PIC.
- and if the button D1 is pressed Hold again during 3 seconds turn OFF the PIC.
What kind of method should I use .. => INTERRUPTS, TIMERS , WDT, POWER UP ??
thank you mr. jinz .
I READ THAT article of link ..
BUT , I need something more specific that use tha same button and lesson me how measure the time that button is pressed... for turn ON and OFF in C language .. :-D :-D
If button is pressed and hold then start a timer immediately when button is pressed and count for 3 sec and check if button is pressed on every interrupt of say 10 ms till 3 sec. If yes then execute whatever code has to be executed. Similar for OFF button.
yeah its basicly like that , but when the time of button pressed taked 3 second turn on the micro , and only is possible to turn off if the button was released and pressed again during 3 second .... I just need a simple sample of how to make something like that THANKS !!
If button is pressed and hold then start a timer immediately when button is pressed and count for 3 sec and check if button is pressed on every interrupt of say 10 ms till 3 sec. If yes then execute whatever code has to be executed. Similar for OFF button.