-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathModuleDigitalInput.h
39 lines (34 loc) · 1.08 KB
/
ModuleDigitalInput.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
/*
* +----------------------+
* | ModuleDigitalInput |
* |----------------------|
* | |
* | output >
* +----------------------+
*
*/
// =============================================================================
//
// ModuleDigitalInput is used for reading one of the digital inputs of the Arduino.
// The pin number of the input to be read is passed in the constructor. Pin
// numbers are defined in defines.h. Outputs "0" for low and "4095" for high.
//
// Unlike analog pins, the pinMode for digital pins must be set in the Arduino's
// setup() routine, liks so:
//
// pinMode([pin number], INPUT);
//
// You should never need to instantiate a ModuleDigitalInput yourself. All of
// the Equation Composer's input modules are created for you and stored in the
// Inputs (see Inputs.h/Inputs.cpp) object.
#ifndef ModuleDigitalInput_h
#define ModuleDigitalInput_h
#include "ModuleInput.h"
class ModuleDigitalInput : public ModuleInput
{
public:
ModuleDigitalInput(int pin);
uint32_t read();
uint16_t compute();
};
#endif