2021-01-29 06:31:58 -05:00
|
|
|
//
|
|
|
|
// FILE: BH1750FVI_setTemperature.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();
|
|
|
|
}
|
|
|
|
|
2021-10-19 10:54:37 -04:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
for (int t = -60; t < 100; t += 10)
|
|
|
|
{
|
|
|
|
myLux.setTemperature(t);
|
|
|
|
float val = myLux.getLux();
|
|
|
|
|
|
|
|
Serial.print(val, 1);
|
|
|
|
Serial.print("\t");
|
|
|
|
Serial.print(myLux.getTemperature());
|
|
|
|
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
|
|
|
// -- END OF FILE --
|
2021-10-19 10:54:37 -04:00
|
|
|
|