mirror of
https://github.com/eclipse/upm.git
synced 2025-07-05 19:31:15 +03:00
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
@ -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);
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user