mirror of
https://github.com/eclipse/upm.git
synced 2025-07-05 19:31:15 +03:00
Added initial interfaces and some sensors implementing them
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
6bf21a23e7
commit
f035470822
@ -59,6 +59,11 @@ float BH1750::getLux()
|
||||
return lux;
|
||||
}
|
||||
|
||||
float BH1750::getLuminance()
|
||||
{
|
||||
return getLux();
|
||||
}
|
||||
|
||||
void BH1750::powerUp()
|
||||
{
|
||||
if (bh1750_power_up(m_bh1750) != UPM_SUCCESS)
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <interfaces/iLight.hpp>
|
||||
|
||||
#include "bh1750.h"
|
||||
|
||||
@ -57,7 +58,7 @@ namespace upm {
|
||||
* @snippet bh1750.cxx Interesting
|
||||
*/
|
||||
|
||||
class BH1750 {
|
||||
class BH1750 : virtual public iLight {
|
||||
public:
|
||||
|
||||
/**
|
||||
@ -92,6 +93,13 @@ namespace upm {
|
||||
*/
|
||||
float getLux();
|
||||
|
||||
/**
|
||||
* Gets the luminance value from the sensor
|
||||
*
|
||||
* @return The measured light intensity value in Lux
|
||||
*/
|
||||
virtual float getLuminance();
|
||||
|
||||
/**
|
||||
* Power up the device.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user