Thread: Sound!
View Single Post
  #8   Spotlight this post!  
Unread 19-08-2009, 23:12
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Sound!

Quote:
Originally Posted by Jared341 View Post
I have done this before as a project on another microcontroller (an HCS12 to be exact). I hooked up a speaker and amplifier to a PWM output and modulated the PWM period to generate different tones (granted, the square PWM wave sounds a little strange, but with a simple RC filter you can get a roughly sinusoidal, single pitch sound).

I suspect that if you were to look at some of Kevin Watson's code on how to use PWM ports 13-16 with custom frequencies, you could probably do something very similar.
I think I will do it like this, could you give me some wiring diagrams?
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib