diff --git a/soler_chager.ino b/soler_chager.ino index b24d948..a815c43 100644 --- a/soler_chager.ino +++ b/soler_chager.ino @@ -34,10 +34,16 @@ void setup() dht.begin(20); 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(count); //Serial.print("] hey\n"); @@ -50,17 +56,19 @@ void loop()// the loop function runs over and over again forever digitalWrite(LED, LOW); } - float hum; - float temp; - temp = dht.readTemperature(); - hum = dht.readHumidity(); + float lux = lightMeter.readLightLevel(); + float hum = dht.readTemperature(); + float temp = dht.readHumidity(); { - Serial.print("humidity: "); + Serial.print("hum: "); Serial.print(hum); - Serial.print(" temperature: "); + Serial.print(" temp: "); Serial.print(dht.convertCtoF(temp)); - Serial.print(" L1 light: "); - Serial.println(lightReadL1); + Serial.print(" L1: "); + Serial.print(lightReadL1); + Serial.print(" PanL: "); + Serial.print(lux); + Serial.println("lx"); delay(50); }