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");
   }
 }

Comentarios

Entradas populares de este blog

Carrito Evita Obstáculos - Práctica HC-SR04

Individual #1: Marquesina en Display LCD

PRÁCTICA #3 PROGRAMACIÓN DEL BUZZER