2021-01-29 06:31:58 -05:00
|
|
|
//
|
|
|
|
// FILE: BH1750FVI_setWaveLength.ino
|
|
|
|
// AUTHOR: Rob Tillaart
|
|
|
|
// VERSION: 0.1.0
|
|
|
|
// PURPOSE: demo of BH1750FVI lux scanner library
|
|
|
|
// DATE: 2020-09-04
|
|
|
|
//
|
|
|
|
|
2021-10-19 10:54:37 -04:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
#include "BH1750FVI.h"
|
|
|
|
|
|
|
|
BH1750FVI myLux(0x23);
|
|
|
|
|
2021-10-19 10:54:37 -04:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
void setup()
|
|
|
|
{
|
|
|
|
Serial.begin(115200);
|
|
|
|
Serial.println();
|
|
|
|
Serial.print(__FILE__);
|
|
|
|
Serial.println();
|
|
|
|
|
|
|
|
Wire.begin();
|
|
|
|
|
|
|
|
myLux.powerOn();
|
|
|
|
myLux.setContHighRes();
|
|
|
|
|
|
|
|
for (int wl = 400; wl < 715; wl++)
|
|
|
|
{
|
|
|
|
myLux.setWaveLength(wl);
|
|
|
|
float val = myLux.getLux();
|
|
|
|
|
|
|
|
Serial.print(val, 1);
|
|
|
|
Serial.print("\t");
|
|
|
|
Serial.print(myLux.getWaveLength());
|
|
|
|
Serial.print("\t");
|
|
|
|
Serial.println();
|
|
|
|
delay(20);
|
|
|
|
}
|
|
|
|
Serial.println();
|
|
|
|
delay(1000);
|
|
|
|
}
|
|
|
|
|
2021-10-19 10:54:37 -04:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-10-19 10:54:37 -04:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
// -- END OF FILE --
|
2021-10-19 10:54:37 -04:00
|
|
|
|