Mercurial > hg > beaglert
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/d-box/AnalogInput.h Fri May 27 13:58:20 2016 +0100 @@ -0,0 +1,55 @@ +/* + * AnalogInput.h + * + * Created on: Oct 17, 2013 + * Author: Victor Zappi + */ + +#ifndef ANALOGINPUT_H_ +#define ANALOGINPUT_H_ + +#include <iostream> +#include <sstream> +#include <stdio.h> +#include <stdlib.h> +#include <glob.h> + +using namespace std; + +class AnalogInput +{ +private: + FILE *ActivateAnalogHnd; + string activateAnalogPath; + bool analogIsSet; + + FILE *AnalogInHnd; + string analogInPath; + bool helperNumFound; + + // suport var for init + string startPath; + string readPath; + + glob_t globbuf; + + // support vars for pin reading + long lSize; + char * buffer; + size_t result; + + bool verbose; + +public: + AnalogInput(); + ~AnalogInput(); + + int initAnalogInputs(); + int read(int index); + +}; + + + + +#endif /* ANALOGINPUT_H_ */