Moran Z. / Mbed OS Fan_Ctlr_PWM_HF
Embed: (wiki syntax)

« Back to documentation index

AjK Namespace Reference

AjK Namespace Reference

DebounceIn adds mechanical switch debouncing to DigitialIn. More...


Detailed Description

DebounceIn adds mechanical switch debouncing to DigitialIn.

Example:

 #include "mbed.h"
 #include "DebounceIn.h"

 DebounceIn  d(p5);
 DigitialOut led1(LED1);
 DigitialOut led2(LED2);

 int main() {
     while(1) {
         led1 = d;
         led2 = d.read();
     }
 }
See also:
set_debounce_us() To change the sampling frequency.
set_samples() To alter the number of samples.

Users of this library may also be interested in PinDetect library:-

See also:
http://mbed.org/users/AjK/libraries/PinDetect/latest

This example shows one input displayed by two outputs. The input is debounced by the default 10ms.