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:
2:6af39916a4a2
Parent:
1:67d677ad73e7
Child:
3:c7f97bebf2f7
--- a/MultiClick.h	Mon Jun 13 08:30:29 2016 +0000
+++ b/MultiClick.h	Mon Jun 13 09:11:53 2016 +0000
@@ -1,6 +1,6 @@
 #include "mbed.h"
 
-#define DEBUG
+//#define DEBUG
 
 #ifdef DEBUG
 #define DBG_PRINT(...) printf(__VA_ARGS__)