I'm trying to get my LCD to display "Voltage= (variable)". I have it programmed to write the text and I have a pot wired to my arduino and I'm trying to get a voltage number to come after the equals sign. How can I program it so when I turn the pot that the actual voltage will come after "Voltage="?
Here's my program
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
void setup()
{
}
void loop()
{
lcd.init();
lcd.backlight();
int sensorPin = A0;
int sensorValue = 0;
sensorValue = 0.004882812 * analogRead(sensorPin) + 1;
lcd.print("Voltage=");
lcd.print(sensorValue);
}