Phaseshift analogRead wave

Yes! This is exactly what I wanted!

Sorry for a very basic question. How do you set the duty cycle in the code you provided?

Now, how do I reduce the amplitude from 5V to 1.5V without any external hardware? Thanks cattledog.