Is there a way to define a function by long pressing the remote key? But I need a way to long press key on ir remote ?
For example after 3 second pressing in case 16.
In the manual, in the FAQ sections, there's a 'timed keypress' chunk of code.
it 'looks' for a pin status AND < certain timout value. Pretty sure you can modify to make it work as you need.
Jay
edit: fromt the 'common questions and answers sectio od the CCS C manual....
...
How do I wait only a specified time for a button press?
The following is an example of how to wait only a specific time for a button press.
#define PUSH_BUTTON PIN_A4
int1 timeout_error;
int1 timed_get_button_press(void){
int16 timeout;
timeout_error=FALSE;
timeout=0;
while(input(PUSH_BUTTON) && (++timeout<50000)) // 1/2 second
delay_us(10);
if(!input(PUSH_BUTTON))
return(TRUE); //button pressed
else{
timeout_error=TRUE;
return(FALSE); //button not pressed timeout occurred
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum