GY-63_MS5611/libraries/BH1750FVI_RT/examples/BH1750FVI_setAngle/BH1750FVI_setAngle.ino
2021-10-19 16:54:37 +02:00

49 lines
687 B
C++

//
// FILE: BH1750FVI_setAngle.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo of BH1750FVI lux scanner library
// DATE: 2020-08-31
//
#include "BH1750FVI.h"
BH1750FVI myLux(0x23);
void setup()
{
Serial.begin(115200);
Serial.println();
Serial.print(__FILE__);
Serial.println();
Wire.begin();
myLux.powerOn();
myLux.setContHighRes();
}
void loop()
{
for (int x = -90; x < 90; x += 1)
{
myLux.setAngle(x);
float val = myLux.getLux();
Serial.print(val, 1);
Serial.print("\t");
Serial.print(myLux.getAngle());
Serial.print("\t");
Serial.println();
delay(20);
}
Serial.println();
}
// -- END OF FILE --