Arduino
#include <LiquidCrystal.h>
  
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
void setup() {
int valorf=analogRead("fotocelda");
int valorh=analogRead("humedad");
delay(10);
lcd.setCursor(0,0);
lcd.print("L");
lcd.print(valorf);
lcd.setCursor(6,0);
lcd.print("H:");
lcd.print(valorh);
if(valorf<500) //no hay sol
{
if(valorf>500) //tierra Seca
{
lcd.setCursor (0,1);
lcd.print("REGAR");
}
else{
lcd.setCursor(0,1);
lcd.print("TIERRA HUMEDA");
}
}
else{
lcd.setCursor(0,1);
lcd.print("HAY SOL");
}
}
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
void setup() {
int valorf=analogRead("fotocelda");
int valorh=analogRead("humedad");
delay(10);
lcd.setCursor(0,0);
lcd.print("L");
lcd.print(valorf);
lcd.setCursor(6,0);
lcd.print("H:");
lcd.print(valorh);
if(valorf<500) //no hay sol
{
if(valorf>500) //tierra Seca
{
lcd.setCursor (0,1);
lcd.print("REGAR");
}
else{
lcd.setCursor(0,1);
lcd.print("TIERRA HUMEDA");
}
}
else{
lcd.setCursor(0,1);
lcd.print("HAY SOL");
}
}
Comentarios
Publicar un comentario