-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathNumericSelector.h
More file actions
executable file
·45 lines (28 loc) · 930 Bytes
/
NumericSelector.h
File metadata and controls
executable file
·45 lines (28 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
This item set a variable to a integer value in a range.
*/
#include <Arduino.h>
#include "MenuItem.h"
#ifndef NumericSelector_h
#define NumericSelector_h
class NumericSelector : public MenuItem {
public:
typedef void(*NumberSelectedCallback)(bool);
NumericSelector(MenuItem* parent, const FlashString* text, uint8_t& variable, uint8_t min, uint8_t max, NumberSelectedCallback callback = NULL);
uint8_t getValue();
uint8_t getMin();
uint8_t getMax();
char getTypeId() { return 's'; };
const char* getSecondaryText();
bool activate();
void deactivate();
void doNext();
void doPrev();
MenuItem* action();
private:
uint8_t& variable;
uint8_t oldValue, min, max;
char valueStr[5];
NumberSelectedCallback callback;
};
#endif