我想用BH1750和arduino mega读取一定量的勒克斯,但是串行监视器不读取它,它只说未配置设备
这是我的代码
#include <Wire.h>
#include <BH1750.h>
BH1750 lightMeter;
void setup() {
// put your setup code here, to run once:
Wire.begin();
Serial.begin(9600);
lightMeter.begin();
Serial.println("Sensing started!...");
delay(500);
}
void loop() {
// put your main code here, to run repeatedly:
uint16_t intensity= lightMeter.readLightLevel();
Serial.print("Light intensity: ");
Serial.print(intensity);
Serial.println(" lx");
delay(500);
}