Initial implementation of iAcceleration
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:
committed by
Mihai Tudor Panu
parent
90524273ec
commit
f992876461
@@ -109,6 +109,15 @@ std::vector<float> LSM303D::getAccelerometer()
|
||||
return std::vector<float>(v, v+3);
|
||||
}
|
||||
|
||||
std::vector<float> LSM303D::getAcceleration()
|
||||
{
|
||||
std::vector<float> v(3);
|
||||
|
||||
lsm303d_get_accelerometer(m_lsm303d, &v[0], &v[1], &v[2]);
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
float LSM303D::getTemperature()
|
||||
{
|
||||
return lsm303d_get_temperature(m_lsm303d);
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include <mraa/gpio.hpp>
|
||||
#include "lsm303d.h"
|
||||
|
||||
#include <interfaces/iAcceleration.hpp>
|
||||
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
@@ -65,7 +67,7 @@ namespace upm {
|
||||
* @snippet lsm303d.cxx Interesting
|
||||
*/
|
||||
|
||||
class LSM303D {
|
||||
class LSM303D: virtual public iAcceleration {
|
||||
public:
|
||||
/**
|
||||
* LSM303D constructor
|
||||
@@ -142,6 +144,13 @@ namespace upm {
|
||||
* that order
|
||||
*/
|
||||
std::vector<float> getAccelerometer();
|
||||
|
||||
/**
|
||||
* get acceleration values
|
||||
*
|
||||
* @return stl vector of size 3 representing the 3 axis
|
||||
*/
|
||||
virtual std::vector<float> getAcceleration();
|
||||
|
||||
/**
|
||||
* Return temperature data in degrees Celsius. NOTE: This is
|
||||
|
||||
Reference in New Issue
Block a user