annotate 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
rev   line source
andrewm@0 1 /*
andrewm@0 2 * AnalogInput.h
andrewm@0 3 *
andrewm@0 4 * Created on: Oct 17, 2013
andrewm@0 5 * Author: Victor Zappi
andrewm@0 6 */
andrewm@0 7
andrewm@0 8 #ifndef ANALOGINPUT_H_
andrewm@0 9 #define ANALOGINPUT_H_
andrewm@0 10
andrewm@0 11 #include <iostream>
andrewm@0 12 #include <sstream>
andrewm@0 13 #include <stdio.h>
andrewm@0 14 #include <stdlib.h>
andrewm@0 15 #include <glob.h>
andrewm@0 16
andrewm@0 17 using namespace std;
andrewm@0 18
andrewm@0 19 class AnalogInput
andrewm@0 20 {
andrewm@0 21 private:
andrewm@0 22 FILE *ActivateAnalogHnd;
andrewm@0 23 string activateAnalogPath;
andrewm@0 24 bool analogIsSet;
andrewm@0 25
andrewm@0 26 FILE *AnalogInHnd;
andrewm@0 27 string analogInPath;
andrewm@0 28 bool helperNumFound;
andrewm@0 29
andrewm@0 30 // suport var for init
andrewm@0 31 string startPath;
andrewm@0 32 string readPath;
andrewm@0 33
andrewm@0 34 glob_t globbuf;
andrewm@0 35
andrewm@0 36 // support vars for pin reading
andrewm@0 37 long lSize;
andrewm@0 38 char * buffer;
andrewm@0 39 size_t result;
andrewm@0 40
andrewm@0 41 bool verbose;
andrewm@0 42
andrewm@0 43 public:
andrewm@0 44 AnalogInput();
andrewm@0 45 ~AnalogInput();
andrewm@0 46
andrewm@0 47 int initAnalogInputs();
andrewm@0 48 int read(int index);
andrewm@0 49
andrewm@0 50 };
andrewm@0 51
andrewm@0 52
andrewm@0 53
andrewm@0 54
andrewm@0 55 #endif /* ANALOGINPUT_H_ */