Sir here the frequency of a waveform if 50hz and the frequency of sin/cos terms are also changed to 50 but nothing is happening again.

Also i have tried FFT library but it only gives magnitude with frequency, but my requirement is to take only 50hz signal and calculate its magnitude and phase angle. I want to measure phase angle between voltage and current vector later which is of 50hz.

Also i have prepared a code for taking analog samples withe 3.2kHz sampling frequency so every cycle of sine wave can have 64 samples. Both the codes are attached here with.

Thank you Mr. MarkT, Mr. Jremington and Mr. GarryP for replaying. I am also thankful to all who have tried to help.

3.2khz_sampler.ino (655 Bytes)

a.ino (1.72 KB)