This code is similar to the Arduino Guitar Tuner by frequency comparison:
www.electrosmash.com/forum/arduino-audio...frequency-comparison
This code will show you in the first row a line that will indicate how far or close (center) are you from the perfect frequency.
In the second row will show the real frequency measured.
Again, this code has many similarities with the Frequency detector:
- If the read is not accurate, try using the Gain potentiometer (if the signal is too big or too small the program will misbehave)
- Make sure that you have a good power supply. I have found that sometimes does not work properly if running on USB power. I guess that you can create some ground loops that make the system unstable
- There is a "counter" variable in the code that can make the code work differently. It delays the display representation, you can experiment changing it to a different valueoretc
- The detected frequency can be also read in the serial monitor
There are many frequency detector codes out there for the Arduino UNO board. This one by Nicole Grimwood works fairly good, but I am sure that you can try some others you find online.
I hope you enjoy it: