annotate service/busyboxArduino/DFR_Key.h @ 408:0787cd64ecf8

cmdline flag on piNode to pick hub host Ignore-this: e88b7bc860b040e6952ddf3723f26a23
author drewp@bigasterisk.com
date Tue, 12 Mar 2019 00:14:12 -0700
parents 28c2db876548
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
157
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
1 #ifndef DFR_Key_h
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
2 #define DFR_Key_h
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
3
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
4 #include "Arduino.h"
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
5
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
6 #define SAMPLE_WAIT -1
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
7 #define NO_KEY 0
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
8 #define UP_KEY 3
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
9 #define DOWN_KEY 4
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
10 #define LEFT_KEY 2
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
11 #define RIGHT_KEY 5
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
12 #define SELECT_KEY 1
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
13
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
14 class DFR_Key
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
15 {
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
16 public:
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
17 DFR_Key();
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
18 int getKey();
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
19 void setRate(int);
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
20 private:
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
21 int _refreshRate;
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
22 int _keyPin;
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
23 int _threshold;
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
24 int _keyIn;
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
25 int _curInput;
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
26 int _curKey;
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
27 int _prevInput;
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
28 int _prevKey;
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
29 boolean _change;
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
30 unsigned long _oldTime;
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
31 };
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
32
28c2db876548 busybox py and arduino
drewp@bigasterisk.com
parents:
diff changeset
33 #endif