Mercurial > hg > beaglert
comparison examples/d-box/AnalogInput.h @ 300:dbeed520b014 prerelease
Renamed projects to examples
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Fri, 27 May 2016 13:58:20 +0100 |
parents | projects/d-box/AnalogInput.h@8a575ba3ab52 |
children |
comparison
equal
deleted
inserted
replaced
297:a3d83ebdf49b | 300:dbeed520b014 |
---|---|
1 /* | |
2 * AnalogInput.h | |
3 * | |
4 * Created on: Oct 17, 2013 | |
5 * Author: Victor Zappi | |
6 */ | |
7 | |
8 #ifndef ANALOGINPUT_H_ | |
9 #define ANALOGINPUT_H_ | |
10 | |
11 #include <iostream> | |
12 #include <sstream> | |
13 #include <stdio.h> | |
14 #include <stdlib.h> | |
15 #include <glob.h> | |
16 | |
17 using namespace std; | |
18 | |
19 class AnalogInput | |
20 { | |
21 private: | |
22 FILE *ActivateAnalogHnd; | |
23 string activateAnalogPath; | |
24 bool analogIsSet; | |
25 | |
26 FILE *AnalogInHnd; | |
27 string analogInPath; | |
28 bool helperNumFound; | |
29 | |
30 // suport var for init | |
31 string startPath; | |
32 string readPath; | |
33 | |
34 glob_t globbuf; | |
35 | |
36 // support vars for pin reading | |
37 long lSize; | |
38 char * buffer; | |
39 size_t result; | |
40 | |
41 bool verbose; | |
42 | |
43 public: | |
44 AnalogInput(); | |
45 ~AnalogInput(); | |
46 | |
47 int initAnalogInputs(); | |
48 int read(int index); | |
49 | |
50 }; | |
51 | |
52 | |
53 | |
54 | |
55 #endif /* ANALOGINPUT_H_ */ |