ok, im having problems with my bh1750, here is all info i got:
board: esp32s nodeMCU v. 1.1
Wiring: (the 2 reds go to pin 21 and 22)
code:
#include <BH1750.h>
#include <Wire.h>
BH1750 lightMeter;
void setup(){
Wire.begin();
Serial.begin(115200);
lightMeter.begin();
if (lightMeter.begin()) {
Serial.println(F("BH1750 initialised"));
}
else {
Serial.println(F("Error initialising BH1750"));
}
}
void loop() {
uint16_t lux = lightMeter.readLightLevel();
Serial.println(lux);
delay(500);
}
Sorry for bad formating
Serial output:
13:01:41.926 -> [BH1750] ERROR: received NACK on transmit of address
13:01:41.926 -> [BH1750] ERROR: received NACK on transmit of address
13:01:41.926 -> Error initialising BH1750
13:01:41.926 -> [BH1750] Device is not configured!
13:01:41.926 -> 65534
13:01:42.430 -> [BH1750] Device is not configured!
13:01:42.430 -> 65534
13:01:42.932 -> [BH1750] Device is not configured!
13:01:42.932 -> 65534
and that goes on forever
Hope someone got an answer :D