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

Dependencies:   microbit

KeyValueInt.h

Committer:
masakjm
Date:
2019-06-06
Revision:
1:9d0e2e5b5d25

File content as of revision 1:9d0e2e5b5d25:

//=================================
//  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