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

@ -112,6 +112,15 @@ void MMA7361::getAcceleration(float *x, float *y, float *z)
mma7361_get_acceleration(m_mma7361, x, y, z);
}
// std::vector<float> MMA7361::getAcceleration()
// {
// std::vector<float> v(3);
// mma7361_get_acceleration(m_mma7361, &v[0], &v[1], &v[2]);
// return v;
// }
float *MMA7361::getAcceleration()
{
static float data[3];

View File

@ -32,6 +32,8 @@
#include "mma7361.h"
// #include <interfaces/iAcceleration.hpp>
namespace upm {
/**
* @brief MMA7361 Analog Accelerometer
@ -57,6 +59,7 @@ namespace upm {
* @snippet mma7361.cxx Interesting
*/
// class MMA7361: virtual public iAcceleration {
class MMA7361 {
public:
@ -150,6 +153,13 @@ namespace upm {
*/
void getAcceleration(float *x, float *y, float *z);
/**
* get acceleration values
*
* @return stl vector of size 3 representing the 3 axis
*/
// virtual std::vector<float> getAcceleration();
/**
* Get computed acceleration from the sensor. update() must have
* been called prior to calling this function.