LCD: create character inside a loop.

Hi folks,

I have a function that displays a bar whose length is proportional to the voltage on an analog pin. I've made 4 custom glyphs for it, and everything is working fine, but for a problem.

I've set up my glyphs with lcd.createChar inside the setup(), because it' won't work otherwise. But, I don't want to occupy 4 places in the LCD's memory for my whole program. I'm looking for a way to set the glyphs on the fly when I call the function to display the bar, and reuse the memory for other glyphs when I'm not displaying the bar.

Moving lcd.createChar calls inside my function doesn't work. Is there a way to do what I want?

How does it not work? What does it actually do?

Show us the code, in < code > tags, please.