Hola! estoy teniendo un problema con quitar los parámetros en una pantalla LCD 20x04 con modulo I2C, ya tengo el código pero no muestra en pantalla, este es el código si alguien puede ayudarme rápido porfavor!
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
//Crear el objeto lcd dirección 0x3F y 16 columnas x 2 filas
LiquidCrystal_I2C lcd(0x27,20,4); //
// variales temporales
unsigned long marca1, marca2;
// Define Trig and Echo pin:
#define trigPin 2
#define echoPin 3
// Define variables:
long duration;
int distance;
float Po;
// Constantes:-
const byte pHpin = A0;// Connect the sensor's Po output to analogue pin 0.
6
{
lcd.init();
lcd.backlight();
}
void loop()
{
if (millis() - marca1 >= 1000) {// Take 10 reading per second.
marca1 = millis();
// Clear the trigPin by setting it LOW:
digitalWrite(trigPin, LOW);
delayMicroseconds(5);
// Trigger the sensor by setting the trigPin high for 10 microseconds:
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Read the echoPin. pulseIn() returns the duration (length of the pulse) in microseconds:
duration = pulseIn(echoPin, HIGH);
// Calculate the distance:
distance = duration * 0.034 / 2;}
lcd.clear();
lcd.setCursor(1, 1);
lcd.print("Parametros del agua:");
lcd.setCursor(2, 1);
lcd.print("pH=" );
lcd.print(Po);
lcd.setCursor(3, 1);
lcd.print("Distancia=" );
lcd.print(distance);
}