frequencies out using SOUND command ?

inglewoodpete

Senior Member
If you use the sound command and you need to know the frequency, you will need to use some form of frequency measuring device. Some multimeters can measure frequency.

Since you're asking that question, I assume you don't have access to an oscilloscope. You can use your computer's sound card: there are a number of free soundcard oscilloscope downloads that are available. You just need to attenuate the 5v squarewave from the PICAXE to something less that 1v P-P, so that you don't overdrive the soundcard.

Alternatively, you can use the Tune command, which provides reasonably accurate frequencies.
 

premelec

Senior Member
Perhaps if you ran the 'sound' into a divider to stretch it to a lower period and then use PULSIN you could come up with some accuracy - you haven't stated just what accuracy you need... There are some very good tuner programs for free to use with your computer microphone input - I don't remember the program names off hand.... Remember the internal PICAXE oscillator is not very accurate if you need really good accuracy...

I looked up a program I use - "APTuner" mostly for music - deviation in cents...
 
Last edited:

westaust55

Moderator
There must be a formula ....
Range of 1 - 127
Yes there is and easily found using a search of the forum. Searching can be your friend. :D

Frequency in Hz = 1 / ( (95exp-6) + ((127-note) x 83exp-6) )

or a possibly easier approximation from here: http://www.picaxeforum.co.uk/archive/index.php/t-20818.html
f = 12000/(128-SOUND).
SOUND=95 will thus give 12000/((128-95) or ~364 Hz, while SOUND=96 yields ~375 Hz.

and as previous;y advised (Aug 2011)by Technical:

if you use a value greater than 127 you get mathematical byte overflow, which results in the command not functioning correctly and so it just makes various strange 'white noise' sounds.
 
Top