class to debouce interrupt pin

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Debounce.h Source File

Debounce.h

00001 #ifndef MBED_DEBOUNCE_H
00002 #define MBED_DEBOUNCE_H
00003 
00004 #include "mbed.h"
00005 
00006 class Debounce {
00007 
00008     public:
00009         Debounce(PinName Pin, int DebounceMS, void (*RiseFunction)(), void (*FallFunction)());
00010   
00011     private:
00012         InterruptIn Input;  
00013         Ticker InputRiseTick;
00014         Ticker InputFallTick;
00015         
00016         float DebounceTime;
00017         
00018         void InputRise();
00019         void InputFall();
00020         void RiseTick();
00021         void FallTick();
00022         
00023         void (*FallFunctionPointer)();
00024         void (*RiseFunctionPointer)();
00025 };
00026 
00027 #endif