famous book
AD conversion
Set a threshold for the collected data, such as a sine wave with Vpp=0-5V, which can be set to 2-3V (the specific number depends on the AD device), and then record the times of data from 2V to 3V per second, so as to calculate the frequency.