mirror of
https://github.com/eclipse/upm.git
synced 2025-07-04 10:51:12 +03:00
Initial implementation of iAcceleration
Signed-off-by: Serban Waltter <serban.waltter@rinftech.com>
This commit is contained in:
@ -108,6 +108,14 @@ std::vector<float> LIS2DS12::getAccelerometer()
|
||||
return std::vector<float>(v, v+3);
|
||||
}
|
||||
|
||||
std::vector<float> LIS2DS12::getAcceleration()
|
||||
{
|
||||
std::vector<float> v(3);
|
||||
|
||||
lis2ds12_get_accelerometer(m_lis2ds12, &v[0], &v[1], &v[2]);
|
||||
return v;
|
||||
}
|
||||
|
||||
float LIS2DS12::getTemperature(bool fahrenheit)
|
||||
{
|
||||
float temperature = lis2ds12_get_temperature(m_lis2ds12);
|
||||
|
@ -31,6 +31,8 @@
|
||||
#include <mraa/gpio.hpp>
|
||||
#include "lis2ds12.h"
|
||||
|
||||
#include <interfaces/iAcceleration.hpp>
|
||||
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
@ -70,7 +72,7 @@ namespace upm {
|
||||
* @snippet lis2ds12.cxx Interesting
|
||||
*/
|
||||
|
||||
class LIS2DS12 {
|
||||
class LIS2DS12: virtual public iAcceleration {
|
||||
public:
|
||||
|
||||
/**
|
||||
@ -135,6 +137,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