Hank, if you have a garbage can handy, bring it next to your computer before you read on........

It looks like you are on the right track to me. If you like your decimals, use the 50 million instead of the 500,000. Then, when you go to print out your number, you can add your decimal back in like this.
Code:
LCDOut dec frequency/100,".",dec frequency//100," Hertz"
For more nausea, check out http://members.cox.net/mathmistakes/music.htm
Not sure if this could help you in any way. A lookup is probably the way to go, but I think this is interesting about the mathematical relationship between the notes.
There are some
important mathematical relationships between the notes played in music and the frequency of those notes.
There are two constant values in music. The first is that the A note that is 9 white keys below middle C has
a frequency of 440 hz. The second constant value in music is the 12th root of 2 (
1.0594630943593...) which is the ratio of the frequencies between half tones. So, the frequency of A# is 440 × 1.059... = 466.16376... The
frequency of B is 466.1637 × 1.0594 = 493.8833. After you do this 12 times you end up with A an octave higher
which equals 880hz. Doubling the frequency creates a note an octave higher. Reversely, dividing the frequency in
half creates a note an octave lower.
I think you might be able to do some interesting things with the constant. The tool to convert things like that to fractions a PIC can use is here: http://www.miscel.dk/MiscEl/miscel.html

Then you could possibly use 3118/2943 or 196/185 get to that constant. Again, not sure that would be useful for a tuner. Maybe more useful for tone generation.
Walter
http://www.scalerobotics.com
Bookmarks