https://code.google.com/p/arduino-tone-ac/ -- Replacement to the standard tone library with many advantages Nearly twice the volume (because it uses two out of phase pins in push/pull fashion) Higher quality (less clicking) Capability of producing higher frequencies (even if running at a lower clock speed) Nearly 1.5k smaller compiled code Bug fixes (standard tone library can generate some odd and unpredictable results) Can set not only the frequency but also the sound volume Less stress on the speaker so it will last longer and sound better Disadvantages are that it must use certain pins and it uses two pins instead of one. But, if you're flexible with your pin choices, this is a great upgrade. It also uses timer 1 instead of timer 2, which may free up a conflict you have with the tone library. It exclusively uses port registers for the fastest and smallest code possible.
Share this library with your friends on your favorite profile: