From 8a69770dbd2b9b2b93d49093196790a2206afe56 Mon Sep 17 00:00:00 2001 From: Roald Batts Date: Thu, 26 Jan 2023 18:30:22 -0500 Subject: [PATCH] panel light is working --- soler_chager.ino | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) 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); }