Thank You Mr. Datman
#include <LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4, 5, 6, 7); //initialize the library, numbers of the interface pins
int analogInput = 1; //analog pin A1
float VoltageOut = 0.0;
float VoltageIn = 0.0;
int refresh = 50; //refresh rate
int i = 0; //variable used for clearing our byte 'graph'
int value = 0; //variable to store value
byte graph[8] =
{
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
};
void setup()
{
pinMode(analogInput, INPUT); //setting analog pin mode to input
lcd.begin(16, 2); //setting up the LCD screens rows and colums
lcd.print("Voltage=");
}
void loop(){
value = analogRead(analogInput); //reading the value on A1
//VoltageOut = (value * 5.0) / 1024.0;
VoltageIn = (value * 5.0) / 1024.0;
//VoltageOut / (R2/(R1+R2));
lcd.setCursor(8, 0); //printing the result to the LCD display
lcd.print(VoltageIn);
lcd.print(" V");
delay(refresh); //refreshing the screen
voltmetergraph(); //calling my function voltmetergraph
}
void voltmetergraph()
{
lcd.setCursor(0,2);
if (VoltageIn >= 0.3125) lcd.write(255); else lcd.print(' ');
lcd.setCursor(1, 2);
if (VoltageIn >= 0.625) lcd.write(255); else lcd.print(' ');
if (VoltageIn >= .9375)
lcd.setCursor(2, 2);
if (VoltageIn >= 1.25) lcd.write(255); else lcd.print(' ');
lcd.setCursor(3, 2);
if (VoltageIn >= 1.25) lcd.write(255); else lcd.print(' ');
lcd.setCursor(4, 2);
if (VoltageIn >= 1.5625) lcd.write(255); else lcd.print(' ');
lcd.setCursor(5, 2);
if (VoltageIn >= 1.875) lcd.write(255); else lcd.print(' ');
lcd.setCursor(5, 2);
if (VoltageIn >= 2.1875) lcd.write(255); else lcd.print(' ');
lcd.setCursor(6, 2);
if (VoltageIn >= 2.5) lcd.write(255); else lcd.print(' ');
lcd.setCursor(7, 2);
if (VoltageIn >= 2.8125) lcd.write(255); else lcd.print(' ');
lcd.setCursor(8, 2);
if (VoltageIn >= 3.125) lcd.write(255); else lcd.print(' ');
lcd.setCursor(9, 2);
if (VoltageIn >= 3.4375) lcd.write(255); else lcd.print(' ');
lcd.setCursor(10, 2);
if (VoltageIn >= 3.75) lcd.write(255); else lcd.print(' ');
lcd.setCursor(11, 2);
if (VoltageIn >= 4.0625) lcd.write(255); else lcd.print(' ');
lcd.setCursor(12, 2);
if (VoltageIn >= 4.375) lcd.write(255); else lcd.print(' ');
lcd.setCursor(13, 2);
if (VoltageIn >= 4.6875) lcd.write(255); else lcd.print(' ');
lcd.setCursor(14, 2);
if (VoltageIn >= 4.99) lcd.write(255); else lcd.print(' ');
lcd.setCursor(15, 2);
if (VoltageIn >= 5.00) lcd.write(255); else lcd.print(' ');
}
Not working right for me.
I like to see ONLY ONE sign in the right place on the lcd like indicator pointer multimeter [ - ] !!!!!!!!!
and not [------- ]
Cannot delete unwanted left-hand boxes [-------- ]
May be refresh or update display made scale slow and my idea is not real in HD44780 lcd