Added iGyroscope interface

Signed-off-by: Serban Waltter <serban.waltter@rinftech.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Serban Waltter
2018-10-02 14:06:17 +03:00
committed by Mihai Tudor Panu
parent 34bb12933d
commit aa966946d5
39 changed files with 222 additions and 47 deletions

View File

@@ -27,6 +27,9 @@
#include <string>
#include <mraa/aio.hpp>
#include <interfaces/iGyroscope.hpp>
#include <interfaces/iTemperature.hpp>
// volts per degree / second (typ)
#define m_degreeCoeff 0.006
@@ -69,7 +72,7 @@ namespace upm {
* @snippet adxrs610.cxx Interesting
*/
class ADXRS610 {
class ADXRS610: virtual public iGyroscope, virtual public iTemperature {
public:
/**
@@ -84,7 +87,7 @@ namespace upm {
/**
* ADXRS610 destructor
*/
~ADXRS610();
virtual ~ADXRS610();
/**
* Returns the voltage detected on the DATA analog pin
@@ -153,6 +156,16 @@ namespace upm {
*/
float getAngularVelocity();
/**
* Return gyroscope data in degrees per second in the form of
* a floating point vector. update() must have been called
* prior to calling this method.
*
* @return A floating point vector containing x, y, and z in
* that order.
*/
std::vector<float> getGyroscope();
protected:
mraa::Aio m_aioData;
mraa::Aio m_aioTemp;