Libraries and Locations

Good Evening Everyone.

I have spent the most of 2 days reading through comments searching for a way to compile my libraries. It was suggested that I download the zip file into the root folder of the Arduino and also into the actual sketchbook library. I now have the same library in two different locations and unfortunately the library is not compiling.

I’m using a MacBook, with the latest version of the Arduino 101 version 1.8.9. I recently uninstalled and reinstalled hoping that would fix the problem, however i still receive the same error message. The particular library I am trying to use is Tone. The error is ‘Tone’ does not name a type. I have the Tone library installed in root folder and in the sketchbook library, and also it shows up in include library in the contributed library section.

#include <Tone.h> //“Tone” is not highlighted however using <tone.h> “tone” is highlighted orange.

I tried both of these with no prevail.

Could anyone offer any assistant, it will be greatly appreciated.

Thanks and Kind Regards

trademarkmen:
It was suggested that I download the zip file into the root folder of the Arduino and also into the actual sketchbook library.

None of those suggestions sound good. I suspect they actually were much more detailed but you think you’re saving time by paraphrasing them. Hint, you’re not saving any time at all by doing that. If you want to have any success with electronics and programming, you need to train yourself to be very precise.

Did you perchance take a look at the official instructions for installing libraries?:
https://www.arduino.cc/en/guide/libraries

trademarkmen:
I now have the same library in two different locations

A very bad idea that is bound to cause you problems.

trademarkmen:
with the latest version of the Arduino 101 version 1.8.9.

I’ve been working with Arduino daily for the last 5 years and I’ve never heard of this "Arduino 101 1.8.9. Are you sure you got that right? Again, precision is essential!

trademarkmen:
The particular library I am trying to use is Tone.

Please post a link (using the chain links icon on the forum toolbar to make it clickable) to where you downloaded that library from. Or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.

trademarkmen:
The error is ‘Tone’ does not name a type.

There is much more to the error than that.

  • When you encounter an error, you’ll see a button on the right side of the orange bar “Copy error messages” in the Arduino IDE (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button…
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply.
  • Press “Ctrl + V”. This will paste the error between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

If the text exceeds the forum’s 9000 character limit, save it to a .txt file and post it as an attachment. If you click the “Reply” button here, you will see an “Attachments and other settings” link.

trademarkmen:
I have the Tone library installed in root folder

Root folder of what? Once more, precision is essential! Being vague like this will only waste your time and ours.

trademarkmen:
and in the sketchbook library

What is the “sketchbook library”?

trademarkmen:
#include <Tone.h> //“Tone” is not highlighted however using <tone.h> “tone” is highlighted orange.

Don’t put too much meaning into the highlighting. Each library author can chose to define any keywords they like. Some library authors define all the keywords of their library. Some library authors don’t bother to define any keywords. Some library authors define some random selection of keywords and never get around to doing the rest. Some library authors attempt to define keywords, but do it wrong so that their keywords aren’t recognized.

Every keyword of every installed library is highlighted, whether or not you’re using that library in your code. So once you have a lot of libraries installed, every other word in your code ends up highlighted.

trademarkmen:
I tried both of these with no prevail.

Rather than trying random things, it’s better to take a minute to understand what’s actually happening. The #include directive refers to a file name in the library. If you want to know which file name to use, you only need to look at the library to see what it is. Or you can look at the example sketches that come with most libraries, which will have the correct #include directive for the library.