We have a device using a CR800 logger and the waitDigTrig() function to trigger actions via a mechanical push-button switch. The code is similar to:
scan(1,sec,0,0)
waitDigTrig(4,0)
call doStuff
nextscan
I've noticed that the action is also sometimes triggered by static discharge, and was wondering if a 'debounce' option might be possible algorithmically. The second parameter to waitDigTrig() is for an Option argument, but it does not seem to support debounce directly. We could perhaps add a brief delay after the trigger and then check the port again.
I notice that section 4.6.3 in a CR1000.pdf manual recommends a pull-up resistor for connecting switch closures for digital I/O, so maybe that's what we should be doing. That might be a better solution than trying to debounce in the program. Any thoughts on this?


