Initial release

Dependencies:   microbit

Committer:
masakjm
Date:
Fri Dec 14 18:40:09 2018 +0000
Revision:
8:be1ae533ab8c
Parent:
3:b6e9850d3e76
Initial release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
masakjm 0:28fb3e9ef81a 1 //=================================
masakjm 0:28fb3e9ef81a 2 // Class KeyValueInt
masakjm 0:28fb3e9ef81a 3 //=================================
masakjm 0:28fb3e9ef81a 4 // The MIT License (MIT) Copyright (c) 2018 Masatomo Kojima
masakjm 0:28fb3e9ef81a 5
masakjm 0:28fb3e9ef81a 6 #ifndef KEY_VALUE_INT
masakjm 0:28fb3e9ef81a 7 #define KEY_VALUE_INT
masakjm 0:28fb3e9ef81a 8
masakjm 0:28fb3e9ef81a 9 class KeyValueInt {
masakjm 3:b6e9850d3e76 10 private:
masakjm 3:b6e9850d3e76 11 int min;
masakjm 3:b6e9850d3e76 12 int max;
masakjm 3:b6e9850d3e76 13 bool rotation;
masakjm 3:b6e9850d3e76 14
masakjm 0:28fb3e9ef81a 15 public:
masakjm 0:28fb3e9ef81a 16 const char *key;
masakjm 0:28fb3e9ef81a 17 char disp;
masakjm 0:28fb3e9ef81a 18 int value;
masakjm 0:28fb3e9ef81a 19 int range(int data);
masakjm 0:28fb3e9ef81a 20 int set(int data);
masakjm 0:28fb3e9ef81a 21 void inc(int delta=1);
masakjm 0:28fb3e9ef81a 22 void dec(int delta=1);
masakjm 0:28fb3e9ef81a 23
masakjm 0:28fb3e9ef81a 24 KeyValueInt(const char *key, char disp=0, int value=0, int min=0, int max=4095, bool rotation=false);
masakjm 0:28fb3e9ef81a 25
masakjm 0:28fb3e9ef81a 26 };
masakjm 0:28fb3e9ef81a 27
masakjm 0:28fb3e9ef81a 28 #endif // KEY_VALUE_INT