|
Re: Sensor "de-noising"
Could you post more information about the sensors you're using, along with how you're using them?
If I were programming a micro controller and I were using a push button switch as an interrupt, I would need to add either a debouncing circuit or a debouncing function in software to ignore unintended repeated taps on the same button as it settles.
Two different ways to accomplish this - in hardware you might add an RC circuit to the button as a low pass filter to remove the bounces, in software you might use a timer to terminate all subsequent interrupts in the range of a millisecond or two.
Not sure what problems you may be having with the proximity sensor.
Another suggestion is to look at your software - what you're interested in the switch might not be if it's pressed or not, rather the state has changed from 0 to 1 or 1 to 0 (rising edge or falling edge).
This is accomplished by storing the old value and XOR'ing it with the new value (state has changed), then AND'ing the result with the old value or the new value.
This won't debounce your circuit, but it will prevent you from running a function in your main loop more than once per button press.
__________________
Be Healthy. Never Stop Learning. Say It Like It Is. Own It.

Like our values? Flexware Innovation is looking for Automation Engineers. Check us out!
|