Debounce InterruptIn

Dependents:   led_sigfox Allumag_lampe_sigfox Case_study_02_Turnstile B18_MP3_PLAYER ... more

Embed: (wiki syntax)

« Back to documentation index

DebouncedInterrupt Class Reference

DebouncedInterrupt Class Reference

typedef enum { IRQ_NONE, IRQ_RISE, IRQ_FALL } gpio_irq_event; More...

#include <DebouncedInterrupt.h>


Detailed Description

typedef enum { IRQ_NONE, IRQ_RISE, IRQ_FALL } gpio_irq_event;

A replacement for InterruptIn that debounces the interrupt

Example:

 #include "DebouncedInterrupt.h"

 DebouncedInterrupt up_button(p15);
 
 void onUp()
 {
    // Do Something
 }
 
 int main()
 {
     up_button.attach(&onUp,IRQ_FALL, 100);
     while(1) {
         ...
     }
 }

Definition at line 40 of file DebouncedInterrupt.h.