panel light is working
This commit is contained in:
parent
3e800795d6
commit
8a69770dbd
1 changed files with 18 additions and 10 deletions
|
@ -34,10 +34,16 @@ void setup()
|
||||||
dht.begin(20);
|
dht.begin(20);
|
||||||
|
|
||||||
Serial.print("done setting up!\n");
|
Serial.print("done setting up!\n");
|
||||||
|
//Intialize the 12C bus
|
||||||
|
Wire.begin();
|
||||||
|
//On esp8266 you can select SCL and SDA pins using Wire.begin
|
||||||
|
//For Wemos /Lolin D1 Mini Pro and the Ambient Light shield use
|
||||||
|
Wire.begin();
|
||||||
|
lightMeter.begin();
|
||||||
|
Serial.println(F("BH1750 Test begin"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop()// the loop function runs over and over again forever
|
void loop(){
|
||||||
{
|
|
||||||
//Serial.print("[");
|
//Serial.print("[");
|
||||||
//Serial.print(count);
|
//Serial.print(count);
|
||||||
//Serial.print("] hey\n");
|
//Serial.print("] hey\n");
|
||||||
|
@ -50,17 +56,19 @@ void loop()// the loop function runs over and over again forever
|
||||||
digitalWrite(LED, LOW);
|
digitalWrite(LED, LOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
float hum;
|
float lux = lightMeter.readLightLevel();
|
||||||
float temp;
|
float hum = dht.readTemperature();
|
||||||
temp = dht.readTemperature();
|
float temp = dht.readHumidity();
|
||||||
hum = dht.readHumidity();
|
|
||||||
{
|
{
|
||||||
Serial.print("humidity: ");
|
Serial.print("hum: ");
|
||||||
Serial.print(hum);
|
Serial.print(hum);
|
||||||
Serial.print(" temperature: ");
|
Serial.print(" temp: ");
|
||||||
Serial.print(dht.convertCtoF(temp));
|
Serial.print(dht.convertCtoF(temp));
|
||||||
Serial.print(" L1 light: ");
|
Serial.print(" L1: ");
|
||||||
Serial.println(lightReadL1);
|
Serial.print(lightReadL1);
|
||||||
|
Serial.print(" PanL: ");
|
||||||
|
Serial.print(lux);
|
||||||
|
Serial.println("lx");
|
||||||
delay(50);
|
delay(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue