This class carries out software debouncing of Digitial in, and provides some method to look at details such as how many debounced rising and falling there have been, and how long the input has been in its current stable state.

Dependencies:   mbed

main.cpp

Committer:
chris
Date:
2009-11-27
Revision:
0:672241227e0d

File content as of revision 0:672241227e0d:

#include "mbed.h"
#include "DebouncedIn.h"


DigitalOut led(LED1);
DebouncedIn button(p21);

int main() {

    while(1) {
        if (button.rising()) {
           led = !led;
        }
    }

}