Debounce function

Hi all,
I am using dynamic c 9.52 and an op7200 and trying to create a debounce function. I am new to embedded programming so I am not sure how to do it? Any help/tips would be greatly appreciated.

FredFlint.