I only have BH1750, MLX90614 on I2C and both do not work on the same line. When I tested the MLX90614 separately, everything worked fine. After connecting the bH1750, everything worked for a few minutes and then I started getting crap over the serial line.
4.00
4.003.00
5.006.00
While the sun is shining, the lux from the BH1750 should measure over 30,000 lux and the MLX90614 should throw -40 in clear skies.
Will you help me how to make it work? My code is below:
#include <Wire.h>
#include <Adafruit_MLX90614.h>
#include <BH1750FVI.h>
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
BH1750FVI LightSensor(BH1750FVI::k_DevModeContLowRes);
uint16_t lux;
void setup() {
Serial.begin(9600);
Wire.begin();
mlx.begin();
LightSensor.begin();
}
void loop() {
if(Serial.available())
{
byte value = Serial.read();
if(value == '1')
{
lux = LightSensor.GetLightIntensity();
Serial.print(lux);
Serial.print("|");
Serial.print(mlx.readObjectTempC());
}
}
}