Hi guys,
First of all sorry for my English. I have a problem with the BH1750, it tells me that it is not well in fact with the i2cdetec, it does not detect it and I no longer know what to do. I have tried everything, pullup resistors as well. I have also tried different BH1750 sensors. I have tested de pins and work. The only thing that I
Here is my code:
#include <Wire.h>
#include <BH1750.h>
#include <i2cdetect.h>
BH1750 lightMeter;
void setup() {
Serial.begin(115200);
// Initialize the I2C bus (BH1750 library doesn't do this automatically)
Wire.begin();
// On esp8266 you can select SCL and SDA pins using Wire.begin(D4, D3);
i2cdetect();
if (lightMeter.begin()) {
Serial.println(F("BH1750 Test begin"));
}
else {
Serial.println(F("BH1750 Initialization FAILED"));
}
}
void loop() {
float lux = lightMeter.readLightLevel();
Serial.print("Light: ");
Serial.print(lux);
Serial.println(" lx");
delay(1000);
}
Here I show de wiring.

Thanks.
Hi guys,
First of all sorry for my English. I have a problem with the BH1750, it tells me that it is not well in fact with the i2cdetec, it does not detect it and I no longer know what to do. I have tried everything, pullup resistors as well. I have also tried different BH1750 sensors. I have tested de pins and work. The only thing that I
Here is my code:
#include <Wire.h>
#include <BH1750.h>
#include <i2cdetect.h>
BH1750 lightMeter;
void setup() {
Serial.begin(115200);
// Initialize the I2C bus (BH1750 library doesn't do this automatically)
Wire.begin();
// On esp8266 you can select SCL and SDA pins using Wire.begin(D4, D3);
i2cdetect();
if (lightMeter.begin()) {
Serial.println(F("BH1750 Test begin"));
}
else {
Serial.println(F("BH1750 Initialization FAILED"));
}
}
void loop() {
float lux = lightMeter.readLightLevel();
Serial.print("Light: ");
Serial.print(lux);
Serial.println(" lx");
delay(1000);
}
Here I show de wiring.

Thanks.