This tutorial will show you how to use Arduino library in eclipse for Arduino. When you have finished reading this tutorial, you will be familiar with:
- Adding a library using the Library Manager
- Adding a library from the library folder
We will need the following for this tutorial:
- Eclipse Arduino IDE (Sloeber)
Start eclipse by clicking on the shortcut you created in the previous tutorial.
When eclipse has fully started go to Arduino ->Preferences and click on Library manager. In the library manager browse for the desired library (e.g. expand Display and look for Liquid Crystal I2C) and check it and click OK. This will install your library into the library folder.
The Eclipse for Arduino library has a standard folder structure and for your library to work you must comply with this folder structure. I.e.
To add a library manually go to your extract folder and open arduinoPlugin then libraries. Inside this folder create a new folder and rename it your library name. Inside this new folder create another folder and rename it to the version of your library. Extract your library into the version folder and clean it up to look like the folder structure above. Now you should be able to use your new library under Arduino -> Add library to selected project
To use your library, select your project and then go to Arduino -> Add library to selected project. Look for your library name, check it and click Ok. Your library will now appear under libraries in your project structure. However to use it, you have to add a reference in your sketch (Blink.ino) i.e.
For further reading please refer to the following links: