hello, wondering a little help on my project for garden irrigation, wondering aid in the visualization of temperature and humidity on the LCD display widget, I have a esp8266 + DHT22 + mousture sensor, someone is kind enough to show me the string to display the temperature and the humidity? precise that the soil moisture sensor value works, thanks in advance
#define BLYNK_PRINT Serial // Enables Serial Monitor
#define MOISTURE A0
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <DHT.h>
#define DHTPIN 12
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
#include <SimpleTimer.h>
int moisture= A0;
int value= A0;
char auth[] = "xxxxxxxxxxxxxxxxxx";
WidgetLCD lcd(V7);
SimpleTimer timer;
void sendData(){
delay(300);
}
int enableZone1 = LOW;
int timerZone1 = LOW;
int manualZone1 = LOW;
int enableZone2 = LOW;
int timerZone2 = LOW;
int manualZone2 = LOW;
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, "xxxxxxx", "xxxxxx");
// Setup a function to be called every second
timer.setInterval(500L, manageZone1);
timer.setInterval(500L, manageZone2);
pinMode(moisture, INPUT);
pinMode(2, OUTPUT); // Zone 1
digitalWrite(2, HIGH);
pinMode(5, OUTPUT); // Zone 2
digitalWrite(5, HIGH);
}
// Zone 1
BLYNK_WRITE(0)
{ enableZone1 = param.asInt(); }
BLYNK_WRITE(1)
{ timerZone1 = param.asInt(); }
BLYNK_WRITE(2)
{ manualZone1 = param.asInt(); }
// Zone 2
BLYNK_WRITE(10)
{ enableZone2 = param.asInt(); }
BLYNK_WRITE(11)
{ timerZone2 = param.asInt(); }
BLYNK_WRITE(12)
{ manualZone2 = param.asInt(); }
void loop() // run over and over again
{
Blynk.run(); // Initiates Blynk
timer.run(); // Initiates SimpleTimer
value= analogRead(moisture);
lcd.print(8, 0, value);
delay(1000);
}
// manage Sprinkler Zone 1
void manageZone1() {
if (((enableZone1 == HIGH) && (timerZone1 == HIGH)) || (manualZone1 == HIGH)) {
digitalWrite(2, LOW);
Blynk.virtualWrite(8, HIGH);
lcd.print(4, 1, "Zona 1 ON");}
else {
digitalWrite(2, HIGH);
Blynk.virtualWrite(8, LOW);
lcd.clear();}
}
// manage Sprinkler Zone 2
void manageZone2() {
if (((enableZone2 == HIGH) && (timerZone2 == HIGH)) || (manualZone2 == HIGH)) {
digitalWrite(5, LOW);
Blynk.virtualWrite(9, HIGH);
lcd.print(4, 1, "Zona 2 ON");}
else {
digitalWrite(5, HIGH);
Blynk.virtualWrite(9, LOW);
lcd.clear();}
}