#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,4);
int analogPin = A0;
float voltage = 0;
float current = 0;
void setup(){
lcd.init();
lcd.backlight();
pinMode(analogPin, INPUT);}
void loop(){
//Read the analog input
int analogValue = analogRead(analogPin);
//Convert analog value to voltage
voltage = analogValue * (5.0 / 1023.0);
// Assuming a specific relationship for simulation, for example:
// current = voltage / resistance (for voltage divider)
// Here we assume resistance = 10 ohms just for example purposes.
current = voltage / 10.0;
//LCD Display
lcd.setCursor(0, 0);
lcd.print("Voltage: ");
lcd.print(voltage);
lcd.print("V");
lcd.setCursor(0, 1);
lcd.print("Current: ");
lcd.print(current);
lcd.print("A");
delay(1000);
}