#include <LiquidCrystal_I2C.h>
#define POT_PIN A0
#define RELAY_PIN 2
#define RGB_R 3
#define RGB_G 5
#define RGB_B 6
LiquidCrystal_I2C xxx (0x27, 16, 2);
void setup() {
  Serial.begin(9600);
  pinMode ( POT_PIN, INPUT );
  pinMode ( RELAY_PIN, OUTPUT );
  pinMode ( RGB_R, OUTPUT );
  pinMode ( RGB_G, OUTPUT );
  pinMode ( RGB_B, OUTPUT );
  xxx.init();
  xxx.backlight();
  xxx.setCursor(0, 0);
  xxx.print ("xxx");

  // put your setup code here, to run once:

}

void loop() {
  xxx.setCursor(0, 0);
  xxx.print ("El valor es: ");
  xxx.setCursor(0, 1);
  xxx.print ("    ");
  xxx.setCursor(0, 1);
  byte humedad = map (analogRead ( POT_PIN ), 0, 1023, 0, 100 );
  if ( humedad < 85 )
    digitalWrite(RELAY_PIN, HIGH);
  else
   digitalWrite(RELAY_PIN, LOW);

  if ( humedad > 0 && humedad <=25)  // seco
     turn_rgb ( 0, 255, 255);  // rojo
  else if ( humedad > 25 && humedad <=50)// semiseco
     turn_rgb ( 0,100, 255); // Amarillo
  else if ( humedad > 50 && humedad <=75) // semihumedo
     turn_rgb ( 255, 255, 0); /// azul
   else if ( humedad > 75 && humedad <=100) //humedo
     turn_rgb ( 255, 0, 255);
  
  xxx.print ( humedad );
  delay(1000);
  
}

void turn_rgb ( byte rojo, byte verde, byte azul ){
  analogWrite(RGB_R, rojo);
  analogWrite(RGB_G, verde);
  analogWrite(RGB_B, azul);
}

void drainWater ( bool humidityFlag ) {

}

void playSong (uint8_t song) {

}
void showValue ( uint8_t data ) {


}

bool Checkhumidity (uint8_t data) {

}

void ledIndicator ( uint8_t data ) {

}

uint8_t getSoilmoisture ( void ) {

}

$abcdeabcde151015202530fghijfghij
NOCOMNCVCCGNDINLED1PWRRelay Module