diff --git a/soler_chager.ino b/soler_chager.ino index af54fe6..b24d948 100644 --- a/soler_chager.ino +++ b/soler_chager.ino @@ -1,16 +1,18 @@ #include #include #include +#include #define DHT11_PIN 7 -#define photos A0 +#define photoL1 A0 #define LED 3 #define button 2 #define buzzer 6 +BH1750 lightMeter; DHT dht(DHT11_PIN, DHT11); volatile int buttonState; -volatile int lightValue = 0; +volatile int lightReadL1 = 0; int count; LiquidCrystal_I2C lcd(0x27, 16, 2); @@ -40,8 +42,8 @@ void loop()// the loop function runs over and over again forever //Serial.print(count); //Serial.print("] hey\n"); - lightValue = analogRead(photos); - if (lightValue > 300){ + lightReadL1 = analogRead(photoL1); + if (lightReadL1 > 300){ digitalWrite(LED, HIGH); } else{ @@ -57,8 +59,8 @@ void loop()// the loop function runs over and over again forever Serial.print(hum); Serial.print(" temperature: "); Serial.print(dht.convertCtoF(temp)); - Serial.print(" light: "); - Serial.println(lightValue); + Serial.print(" L1 light: "); + Serial.println(lightReadL1); delay(50); }