#include <LiquidCrystal_I2C.h>
// Initialize the LCD screen
LiquidCrystal_I2C lcd(0x27, 16, 2);
// Define the analog pin for voltage measurement
const int voltagePin = A0;
void setup() {
// Initialize the LCD screen
lcd.begin(16, 2);
lcd.backlight();
// Set up the voltage pin as an input
pinMode(voltagePin, INPUT);
}
void loop() {
// Read the voltage from the analog pin
int rawValue = analogRead(voltagePin);
// Convert the raw value to voltage (assuming 5V reference)
float voltage = rawValue * (100 / 1023.0);
// Display the voltage on the LCD screen
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Nitrogeno:");
lcd.print(voltage);
lcd.print("m3");
// Wait for a short delay before updating the display
delay(500);
}