I hope that project has worked. If the LCD is very sluggish (typical STN displays are) then you may get a readable result. I would strongly recommend a 10K trimpot. All the liquid crystals need is a small static voltage to align. If you can’t see anything with PWM, try a low-pass filter to get a more constant voltage.
As far I my test goes, here’s the code, pretty straight forward.
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(4, 5, 6, 7, 8, 9);
// set up the LCD’s number of rows and columns:
// initialize the serial communications:
// clear the screen
for (int i=100; i<130;i+=1)
for (int i=130; i>100;i-=1)
I ramp up and down my PWM (no low-pass filter). I can see that only the first few numbers near 100 are good and as voltage gets higher the ripples get more and more obvious until it’s back to the start of the next loop run. Weired. I also tried to ramp it from 85 to 120, no the way back to 85, the display rippled all the way down to 86. Then loop is re-run at 85 and the display abruptly becomes good and stable. Even when the displayed characters are ok with PWM, the background slightly ripples. I’ll definitely, use a trimpot, no ripples.