I am trying to add a function to a program I am editing. In this program, I have various If statements that use a Microsoft Kinect device to check wherever a person is in a certain position or to check what their head movement is like etc, and depending what they are doing, display a type of feedback.
if (pitch > 10)
{
//display icon
}
else if (pitch <10)
{
//display icon
}
//etc..
At the moment, the icon is turning on/off rapidly depending on the users movement. As this may be confusing for users, I want the condition to match for some seconds before displaying it. e.g. if (pitch > 10) for X seconds then the display icon.
Not sure what the most efficient way of doing this, I have tried a timer and task delay but I think this just delays the results rather than check the condition over a time period.