Making noise with arduino
Posted on 14:54 by Flyku
Since i started using arduino i have been looking for new ways of getting technology to interact with anyone using it and visa versa. A great way to do this is to use sound, however untill recently, in my experience this has been relatively hard to do.
A new library in the arduino IDE has solved this, the Tone( ) function allows you to generate a square wave with a frequency of your choosing. By connecting a Piezo or 8ohm speaker to a digital I/O on the arduino you can call tone( pin , frequency, duration ) and create single tones or melodies very simply. The best part of this library is that the tone( ) function doesn't cause any delays in the rest of the program.
Another way of adding audio to your project is to use an additional circuit like the Sparkfun MP3 trigger, using a circuit like this you can copy MP3 files to an SD card and play them back using a trigger from the arduino. This would be great for adding voice or music to your project or for giving your robot a voice :)
So far i have added an 8 ohm speaker to my robot and got it to make little beepy noises but in the future i want to give it a voice, so look forward to more updates soon.
0 comments:
Post a Comment