Introduction - If you have any usage issues, please Google them yourself
Hardware to achieve two-way square wave integration, integration of a square wave, and the final program with input acquisition function to measure phase difference, thereby obtaining power factor