Software > Software

Send out specific frequency from AT Mega 8

(1/2) > >>

HDL_CinC_Dragon:
Is there a way that I can program my AT Mega 8 to output a specific frequency, lets say 6kHz(6000Hz) just for an example, to any one of the B, C, D pins?

hazzer123:
Maybe you could use one of the timers to interrupt every 1/6000th of a second. This would let you get on with other things at the same time. Maybe there are other ways you could do it using hardware, but i don't know much about ATMega chips.

Robotboy86:
Does it have a sound command?  Those are usually good for sending out a frequency.  Or you could get a voltage -> frequency ic..

HDL_CinC_Dragon:
I want to be able to hook up a piezo disc to the pin and have it play at what ever frequency is running out of that pin.

Admin:
Since you dont care about any particular frequency, use the exact same code that I use for servos on my $50 Robot. Then just change the frequency until you hear a sound.

If you want a perfect frequency, hook up the output pin to an oscope.

Navigation

[0] Message Index

[#] Next page

Go to full version