1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <BH1750FVI.h>
BH1750FVI LightSensor(BH1750FVI::k_DevModeContLowRes);
void setup()
{
Serial.begin(9600);
LightSensor.begin();
}
void loop()
{
uint16_t lux = LightSensor.GetLightIntensity();
Serial.print("Light: ");
Serial.print(lux);
Serial.println(" lux");
delay(250);
}