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
@ -629,6 +629,13 @@ std::vector<float> LSM9DS0::getAccelerometer()
|
||||
return v;
|
||||
}
|
||||
|
||||
std::vector<float> LSM9DS0::getAcceleration()
|
||||
{
|
||||
std::vector<float> v(3);
|
||||
getAccelerometer(&v[0], &v[1], &v[2]);
|
||||
return v;
|
||||
}
|
||||
|
||||
std::vector<float> LSM9DS0::getGyroscope()
|
||||
{
|
||||
std::vector<float> v(3);
|
||||
|
@ -30,6 +30,8 @@
|
||||
|
||||
#include <mraa/gpio.hpp>
|
||||
|
||||
#include <interfaces/iAcceleration.hpp>
|
||||
|
||||
#define LSM9DS0_I2C_BUS 1
|
||||
#define LSM9DS0_DEFAULT_XM_ADDR 0x1d
|
||||
#define LSM9DS0_DEFAULT_GYRO_ADDR 0x6b
|
||||
@ -77,7 +79,7 @@ namespace upm {
|
||||
* @snippet lsm9ds0.cxx Interesting
|
||||
*/
|
||||
|
||||
class LSM9DS0 {
|
||||
class LSM9DS0: virtual public iAcceleration {
|
||||
public:
|
||||
|
||||
// NOTE: reserved registers must not be written into or permanent
|
||||
@ -1274,6 +1276,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();
|
||||
|
||||
/**
|
||||
* get the gyroscope values in degrees per second
|
||||
*
|
||||
|
Reference in New Issue
Block a user