Treehopper C++ API
Bh1750.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
Libraries/Pollable.h
>
4
#include <
I2c.h
>
5
#include <
SMBusDevice.h
>
6
#include "
AmbientLightSensor.h
"
7
8
namespace
Treehopper
{
9
namespace
Libraries {
10
namespace
Sensors {
11
namespace
Optical {
12
class
LIBRARIES_API
Bh1750
:
public
virtual
AmbientLightSensor
{
13
public
:
14
enum class
LuxResolution
{
15
Medium
,
16
High
,
17
Low
18
};
19
20
Bh1750
(
I2c
&i2c,
bool
addressPin =
false
,
int
rate = 100);
21
22
void
update();
23
24
LuxResolution resolution();
25
26
void
resolution(LuxResolution resolution);
27
28
private
:
29
SMBusDevice
dev;
30
LuxResolution _resolution;
31
};
32
}
33
}
34
}
35
}
AmbientLightSensor.h
Treehopper::Libraries::Sensors::Optical::Bh1750
Definition:
Bh1750.h:12
Treehopper::I2c
Base I2c interface.
Definition:
I2c.h:10
Treehopper::SMBusDevice
Definition:
SMBusDevice.h:7
Treehopper::Libraries::Sensors::Optical::AlsGains::Low
SMBusDevice.h
I2c.h
Treehopper::Libraries::Sensors::Optical::Bh1750::LuxResolution
LuxResolution
Definition:
Bh1750.h:14
Treehopper::Libraries::Sensors::Optical::AlsGains::High
Treehopper::Libraries::Sensors::Optical::AmbientLightSensor
Definition:
AmbientLightSensor.h:9
Pollable.h
Treehopper::Libraries::Sensors::Optical::AlsGains::Medium
LIBRARIES_API
#define LIBRARIES_API
Definition:
Treehopper.Libraries.h:17
Treehopper
Definition:
AdcPin.h:3
C++
API
inc
Libraries
Sensors
Optical
Bh1750.h