Mercurial > hg > beaglert
diff projects/d-box/AnalogInput.h @ 0:8a575ba3ab52
Initial commit.
author | andrewm |
---|---|
date | Fri, 31 Oct 2014 19:10:17 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/projects/d-box/AnalogInput.h Fri Oct 31 19:10:17 2014 +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_ */