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 }
Base I2c interface.
Definition: I2c.h:10
Definition: SMBusDevice.h:7
#define LIBRARIES_API
Definition: Treehopper.Libraries.h:17
Definition: AdcPin.h:3