mirror of
				https://github.com/eclipse/upm.git
				synced 2025-11-04 00:54:21 +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
				
			@@ -234,6 +234,15 @@ LIS3DH::getAccelerometer()
 | 
			
		||||
    return std::vector<float>(v, v + 3);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
std::vector<float>
 | 
			
		||||
LIS3DH::getAcceleration()
 | 
			
		||||
{
 | 
			
		||||
    std::vector<float> v(3);
 | 
			
		||||
 | 
			
		||||
    lis3dh_get_accelerometer(m_lis3dh, &v[0], &v[1], &v[2]);
 | 
			
		||||
    return v;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
float
 | 
			
		||||
LIS3DH::getTemperature(bool fahrenheit)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -35,6 +35,8 @@
 | 
			
		||||
#include "lis3dh.h"
 | 
			
		||||
#include <mraa/gpio.hpp>
 | 
			
		||||
 | 
			
		||||
#include <interfaces/iAcceleration.hpp>
 | 
			
		||||
 | 
			
		||||
namespace upm
 | 
			
		||||
{
 | 
			
		||||
/**
 | 
			
		||||
@@ -72,7 +74,7 @@ namespace upm
 | 
			
		||||
 * @snippet lis3dh.cxx Interesting
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
class LIS3DH
 | 
			
		||||
class LIS3DH: virtual public iAcceleration
 | 
			
		||||
{
 | 
			
		||||
  public:
 | 
			
		||||
    /**
 | 
			
		||||
@@ -304,6 +306,13 @@ class LIS3DH
 | 
			
		||||
     */
 | 
			
		||||
    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