Hello my friends,
I need to generate two sine waves at 60Hz and the second wave will be 180 degrees out of phase using arduino with atmega2560! Does anyone have any code because I have no idea where to start!
In the attachment, the waves were generated in 12V 60Hz for sampling in oscilloscope using Proteus Isis.
How pure is "pure"?
For instance, there is no such thing as a perfect sphere. But many of them are "good enough".
You could make an R-2R ladder DAC and pipe in calculated sine values from 0 to 255 into it. At 5 volts, that gives you about 20 millivolts per step (that is, if you looked at the sine wave on a scope, it would be composed of small, but discrete steps as opposed to a "pure" sine wave coming from a rotating device or a signal generator.
If you use the Arduino PWM and filter it, I doubt you will be able to change the PWM rate fast enough to get a sine output.
As far as 180 degrees out of phase... all you need is a unity gain inverting op-amp (if you don't want to bother building two DAC's).