GY-63_MS5611/libraries/BH1750FVI_RT/examples/BH1750FVI_setAngle/BH1750FVI_setAngle.ino
2021-01-29 12:31:58 +01:00

44 lines
682 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 --