BLE switch interface using micro:bit with 3 tact switches or 3 Makey Makey sensors

Dependencies:   microbit

Revision:
1:9d0e2e5b5d25
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/KeyValueInt.h	Thu Jun 06 19:06:06 2019 +0000
@@ -0,0 +1,28 @@
+//=================================
+//  Class KeyValueInt
+//=================================
+//    The MIT License (MIT)   Copyright (c) 2018 Masatomo Kojima
+
+#ifndef   KEY_VALUE_INT
+#define   KEY_VALUE_INT
+
+class KeyValueInt {
+    private:
+        int min;
+        int max;
+        bool rotation;
+
+    public:
+        const char *key;
+        char disp;
+        int value;
+        int range(int data);
+        int set(int data);
+        void inc(int delta=1);
+        void dec(int delta=1);
+
+    KeyValueInt(const char *key, char disp=0, int value=0, int min=0, int max=4095, bool rotation=false);
+    
+};
+
+#endif // KEY_VALUE_INT