You can use multiple clicks event with one button. This library supports follow events, Single click, Double click, over 3 times click, Long press.

Dependents:   multiclick_test

Revision:
4:8d6883cdc3c8
Parent:
3:c7f97bebf2f7
Child:
5:cb4d45f41e17
--- a/MultiClick.h	Mon Jun 13 10:15:15 2016 +0000
+++ b/MultiClick.h	Wed Jun 15 05:17:19 2016 +0000
@@ -38,8 +38,10 @@
     int _longpress_us;
     int _click_times;
     
+//    bool _pressed;
     bool _debounce_ignore;
     bool _longpressed;
+    
     void (*_c_callback_clicked)(void);
     void (*_c_callback_doubleclicked)(void);
     void (*_c_callback_n_clicked)(int);