annotate service/busyboxArduino/DFR_Key.h @ 984:5da9200418db

reasoning: -v verbose setting, more oneshot support, some custom stuff for mpd commands Ignore-this: 7646fba7b5496eb1f33a87452af6c6de darcs-hash:20150514083000-312f9-ef4db22cf33250e690b6021b6b1968cc788d14cb
author drewp <drewp@bigasterisk.com>
date Thu, 14 May 2015 01:30:00 -0700
parents 70fd4c07a326
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
962
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
1 #ifndef DFR_Key_h
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
2 #define DFR_Key_h
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
3
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
4 #include "Arduino.h"
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
5
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
6 #define SAMPLE_WAIT -1
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
7 #define NO_KEY 0
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
8 #define UP_KEY 3
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
9 #define DOWN_KEY 4
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
10 #define LEFT_KEY 2
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
11 #define RIGHT_KEY 5
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
12 #define SELECT_KEY 1
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
13
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
14 class DFR_Key
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
15 {
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
16 public:
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
17 DFR_Key();
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
18 int getKey();
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
19 void setRate(int);
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
20 private:
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
21 int _refreshRate;
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
22 int _keyPin;
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
23 int _threshold;
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
24 int _keyIn;
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
25 int _curInput;
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
26 int _curKey;
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
27 int _prevInput;
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
28 int _prevKey;
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
29 boolean _change;
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
30 unsigned long _oldTime;
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
31 };
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
32
70fd4c07a326 busybox py and arduino
drewp <drewp@bigasterisk.com>
parents:
diff changeset
33 #endif