LCD Bar Graph

Hey,

I'm trying to implement a bar graph. The input comes from a voltage source that goes from 0-5v. I want this to occupy a single line on a 16x2 screen. I already know how to interface with the screen, and thats done. The issue comes from where to start...

I read the posts already on bar graphs, but they either don't explain enough or aren't the type I want. I want the line to be blank when 0V and full when 5V.

The input is coming from an analog input. I'm literally lost.

Any ideas?

I want this to occupy a single line on a 16x2 screen.

Does this mean you have an LCD display?

Take the reading from the analogue channel, that will be a number between 0 and 1023, on your display you only have 16 characters so divide that number by 64. Then the result is how many fully black characters to write. Do this in a for loop.

Good idea. Thanks. I was thinking of using the voltage, for some reason, using the direct resolution from the analog input will do a much better job!

If your display supports user defined characters, you might be able to define a set of characters that divide the black block normally used by one character position in 4 (or more) progressively wider blocks, this way you could get a better resolution than the 16 standard chars alone.