Quote:
Originally Posted by Barchechath
I some need kind of delay because when i press the button once the robot doing the open and close command too fast.
And that is why i am searching for a delay of something like two seconds.
|
If I understand your needs properly, Eric is correct: what you want is a counter.
Process_Data_From_Master_uP() is executed about every 26 milliseconds. Check the state of the button in that routine (or in another routine called from it). If the button is pressed, increment the counter; if the button is not pressed, set the counter to zero. If the counter reaches 76, you know the button has been held for two seconds, and you can take some action.
If that doesn't sound like what you need, please give some more detail about what you want the button to do.