BLE switch interface with GROVE joystic for micro:bit http://mahoro-ba.net/e2073.html

Dependencies:   microbit

KeyValueInt.h

Committer:
masakjm
Date:
2019-04-09
Revision:
21:961da341b755
Parent:
3:b6e9850d3e76

File content as of revision 21:961da341b755:

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