Initial implementation of iAcceleration

Signed-off-by: Serban Waltter <serban.waltter@rinftech.com>
This commit is contained in:
Serban Waltter
2018-07-26 18:06:33 +03:00
parent d431d1458e
commit a411723e5c
48 changed files with 512 additions and 35 deletions

View File

@ -114,6 +114,14 @@ std::vector<float> BMA250E::getAccelerometer()
return std::vector<float>(v, v+3);
}
std::vector<float> BMA250E::getAcceleration()
{
std::vector<float> v(3);
bma250e_get_accelerometer(m_bma250e, &v[0], &v[1], &v[2]);
return v;
}
float BMA250E::getTemperature(bool fahrenheit)
{
float temperature = bma250e_get_temperature(m_bma250e);

View File

@ -31,6 +31,8 @@
#include <mraa/gpio.hpp>
#include "bma250e.h"
#include <interfaces/iAcceleration.hpp>
namespace upm {
/**
@ -73,7 +75,7 @@ namespace upm {
* @snippet bma250e.cxx Interesting
*/
class BMA250E {
class BMA250E: virtual public iAcceleration {
public:
/**
@ -138,6 +140,13 @@ namespace upm {
*/
std::vector<float> getAccelerometer();
/**
* get acceleration values
*
* @return stl vector of size 3 representing the 3 axis
*/
virtual std::vector<float> getAcceleration();
/**
* Return the current measured temperature. Note, this is not
* ambient temperature. update() must have been called prior to