48 lines
702 B
Arduino
Raw Normal View History

2021-01-29 12:31:58 +01:00
//
// FILE: BH1750FVI_setTemperature.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo of BH1750FVI lux scanner library
// DATE: 2020-09-04
2021-10-19 16:54:37 +02:00
2021-01-29 12:31:58 +01:00
#include "BH1750FVI.h"
BH1750FVI myLux(0x23);
2021-10-19 16:54:37 +02:00
2021-01-29 12:31:58 +01:00
void setup()
{
Serial.begin(115200);
Serial.println();
Serial.print(__FILE__);
Serial.println();
Wire.begin();
myLux.powerOn();
myLux.setContHighRes();
}
2021-10-19 16:54:37 +02:00
2021-01-29 12:31:58 +01: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 16:54:37 +02:00
2023-10-18 16:41:42 +02:00
// -- END OF FILE --
2021-10-19 16:54:37 +02:00