-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPin.h
43 lines (37 loc) · 1.14 KB
/
Pin.h
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
#ifndef Pin_h
#define Pin_h
// Pin Types must be in sync
// with Arduino.getMrlPinType
#define DIGITAL 0
#define ANALOG 1
/***********************************************************************
* PIN - This class represents one of the pins on the arduino and it's
* status in MRLComm.
*/
class Pin {
public:
int type; // might be useful in control
int address; // pin #
int value;
// int state; // state of the pin - not sure if needed - reading | writing | some other state ? - dont add it until necessary
// int readModulus; // rate of reading or publish sensor data
int debounce; // long lastDebounceTime - minDebounceTime
// number of reads ?
unsigned long target;
// TODO: review/remove move the following members
// to support pulse.
int count;
// remove me
unsigned int rate;
unsigned long lastUpdate;
// remove me, needed for pulse
// int rateModulus;
// default constructor for a pin?
// at a minimum we need type and address A0 D4 etc...
Pin(int addr, int t, unsigned int rate) {
type = t;
address = addr;
this->rate = rate;
};
};
#endif