Why isn't this PWM code giving me 5V?

They clearly do mean DC, but the point is that you have to apply that same voltage alternately in both directions, so you require an excursion of twice that to apply through the capacitor. And with the capacitor that you do need to block DC, it is suggested you have a resistor across the LCD to actually zero the voltage and clear it when you stop applying the alternating current.

1 Like