How to get voltage on lcd (line 1) to be proportional to custom lcd user generated Char (line2)

AlbertHall

Joined Jun 4, 2014
12,347
I kind of did that with this code
No you didn't.
The for loop will print the necessary number of blocks and then exit. Within that loop 'i' will never equal 'sum'.
After the for loop ends you need another for loop which runs from 'sum' to 16 and writes spaces.

That would be the simple way to do it.
You could make it more 'intelligent' by keeping track of the last number of blocks and then adding or deleting blocks as necessary but that's more difficult to write.
 

Thread Starter

HappyC4mper

Joined Oct 13, 2017
71
No you didn't.
The for loop will print the necessary number of blocks and then exit. Within that loop 'i' will never equal 'sum'.
After the for loop ends you need another for loop which runs from 'sum' to 16 and writes spaces.

That would be the simple way to do it.
You could make it more 'intelligent' by keeping track of the last number of blocks and then adding or deleting blocks as necessary but that's more difficult to write.
Ah i see.
Sorry if it's a hassle, but do you mind showing me an example of the more intelligent way? cheers.
 
Top