Treehopper C++ API
Vcnl4010.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <I2c.h>
5 #include <SMBusDevice.h>
7 #include "AmbientLightSensor.h"
8 #include "Vcnl4010Registers.h"
9 
10 namespace Treehopper {
11  namespace Libraries {
12  namespace Sensors {
13  namespace Optical {
14  class LIBRARIES_API Vcnl4010 : public virtual ProximitySensor, public virtual AmbientLightSensor {
15  public:
16  Vcnl4010(I2c &i2c, int rate = 100);
17 
18  void update();
19 
20  double rawProximity();
21 
22  private:
23  SMBusDevice dev;
24  Vcnl4010Registers registers;
25  double _rawProximity;
26  };
27  }
28  }
29  }
30 }
Base I2c interface.
Definition: I2c.h:10
Definition: SMBusDevice.h:7
Definition: ProximitySensor.h:11
#define LIBRARIES_API
Definition: Treehopper.Libraries.h:17
Definition: AdcPin.h:3