go_away
Society of Robots - Robot Forum
|
Robot Tutorials
|
FAQ
|
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Squirrels have fuzzy tails.
Home
Help
Search
Login
Register
Society of Robots - Robot Forum
»
Software
»
Software
»
Send out specific frequency from AT Mega 8
Print
Author
Topic: Send out specific frequency from AT Mega 8 (Read 4023 times)
0 Members and 1 Guest are viewing this topic.
HDL_CinC_Dragon
Supreme Robot
Posts: 1,261
Helpful? 5
Send out specific frequency from AT Mega 8
«
on:
July 30, 2007, 07:23:36 AM »
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?
Logged
United States Marine Corps
Infantry
Returns to society: 2014JAN11
hazzer123
Supreme Robot
Posts: 460
Helpful? 3
Re: Send out specific frequency from AT Mega 8
«
Reply #1 on:
July 30, 2007, 08:45:57 AM »
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.
Logged
Imperial College Robotics Society
www.icrobotics.co.uk
Robotboy86
Robot Overlord
Posts: 139
Helpful? 0
Re: Send out specific frequency from AT Mega 8
«
Reply #2 on:
July 31, 2007, 05:25:50 PM »
Does it have a sound command? Those are usually good for sending out a frequency. Or you could get a voltage -> frequency ic..
Logged
HDL_CinC_Dragon
Supreme Robot
Posts: 1,261
Helpful? 5
Re: Send out specific frequency from AT Mega 8
«
Reply #3 on:
July 31, 2007, 07:41:29 PM »
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.
Logged
United States Marine Corps
Infantry
Returns to society: 2014JAN11
Admin
Administrator
Supreme Robot
Posts: 11,702
Helpful? 173
Re: Send out specific frequency from AT Mega 8
«
Reply #4 on:
August 02, 2007, 11:58:46 AM »
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.
Logged
subscribe to SoR's YouTube account
HDL_CinC_Dragon
Supreme Robot
Posts: 1,261
Helpful? 5
Re: Send out specific frequency from AT Mega 8
«
Reply #5 on:
August 02, 2007, 01:38:25 PM »
Well since I dont have an OScope and theyre expensive that option is out lol but I can get hold of one for a bit when the school year starts up again (
)
Right now I cant experiment with anything like that at the moment because I need to buy a battery charger so I can use my battery again since the USB cable doesnt put out nearly enough amperage (about .4A)
Thanks for your help Admin
Logged
United States Marine Corps
Infantry
Returns to society: 2014JAN11
Admin
Administrator
Supreme Robot
Posts: 11,702
Helpful? 173
Re: Send out specific frequency from AT Mega 8
«
Reply #6 on:
August 02, 2007, 03:42:31 PM »
Cant find any power supplies around to charge your batteries?
Logged
subscribe to SoR's YouTube account
HDL_CinC_Dragon
Supreme Robot
Posts: 1,261
Helpful? 5
Re: Send out specific frequency from AT Mega 8
«
Reply #7 on:
August 02, 2007, 05:45:01 PM »
Well I could probably make one... But I think it would be best if I just bought
a smart one
so I dont risk killing my battery...
Logged
United States Marine Corps
Infantry
Returns to society: 2014JAN11
Print
Society of Robots - Robot Forum
»
Software
»
Software
»
Send out specific frequency from AT Mega 8
Get Your Ad Here
data_list