Dude!
There is nothing wrong with the example program or the Tone library.
The problem is the Arduino IDE. It can be a little uncooperative when adding a new library.
Make sure you have the Tone folder where it is supposed to be. Delete the #include <Tone>; line from the sketch. Save the sketch. Close down all Arduino IDE windows. (Maybe even reboot your computer) Open the sketch in the IDE. Use the menu tab to Import the library. Compile the sketch.
Can I assume that this is you first go around with a library? Allow me to share the "Facts of Arduino Life" with you about 3rd party Contributed Libraries.
On 11/30/2011 10:08 PM, David Cuartielles wrote:
When it comes to the software, it is not Arduino's responsibility to
fix the libraries developed by third parties. It is like in any other
systems, the responsibility of those third parties to fix what stops
working at each update.
These contributed libraries live in a folder called: C:\...\Arduino\libraries\ whereas the officially supported libraries live in a folder called: C:\...\Arduino\arduino-0023\arduino-0023\libraries. If the contributed libraries folder does not exist then you must create it.
Please note: A professional quality library will come with one or more example sketches. Do not ignore them; they are valuable resources.
Just like the Radio Shack document said:
Install the Tone Library
For this project, you’ll need to install the “Tone” library, which can be downloaded here: http://code.google.com/p/rogue-code/wiki/ToneLibraryDocumentation
When you unzip the downloaded file, it will create a “Tone” folder. This folder should be moved to the “Libraries” folder, which is in your Arduino sketchbook folder. If you’re not sure of your sketchbook folder location, it can be found in your Arduino preferences. If the “libraries” folder doesn’t exist, create it, then copy the “Tone” folder to that location. Restart your Arduino application. You should now see “Tone” when you select from the menu bar:
Sketch > Import Library... (look under “Contributed”)