You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to create a library with the Arduino Eclipse plugin.
2
-
==
3
-
4
-
>This guideline assumes you have basic knowledge of sloeber and CDT. This means we do not go into details of "commonly used functionality". We stick to the "library creation". Also allow for differences in the images when verifying your steps. These images may have been taken over different versions of sloeber and different oses.
5
-
6
-
With Sloeber you have a real development environment which allows you to modify libraries as if they are part of your code, so you may wonder: "how can I make my own libraries?" There are plenty of ways; but here is one to get you going.
7
-
8
-
**start by having a project**
1
+
How to create a library with the Arduino Eclipse plugin.
2
+
==
3
+
4
+
>This guideline assumes you have basic knowledge of sloeber and CDT. This means we do not go into details of "commonly used functionality". We stick to the "library creation". Also allow for differences in the images when verifying your steps. These images may have been taken over different versions of sloeber and different oses.
5
+
6
+
With Sloeber you have a real development environment which allows you to modify libraries as if they are part of your code, so you may wonder: "how can I make my own libraries?" There are plenty of ways; but here is one to get you going.
7
+
8
+
**start by having a project**
9
9
For sake of this demo I created a empty workspace and created a sketch in there.
10
-
Here is what it looks like on my system:
11
-

12
-
13
-
**write your first version of the library code**
14
-
In most cases you will start by simply creating a class (right click the project and select new class) into an existing project.
15
-
Later you will decide that this class/code is worth to be upgraded to a library.
16
-
So we create a class in our project with the name of the library we want to create.
17
-

18
-
19
-
**Outside of eclipse: create a subfolder with the library name in one of your private library folders**
20
-
As I have C:\Users\jan\Documents\Arduino\libraries listed as a private Library; I created a folder in C:\Users\jan\Documents\Arduino\libraries with the name Libcodeclass.
21
-
Add a file with extension .h in the folder (I used findMe.h)
22
-

23
-
24
-
Note that it is a good practice to have the same name for the folder as for the header file (that is even with casing).
25
-
26
-
**Import the library into your project**
27
-
Because we created a "folder containing code" on disk the plugin can add the "library" (with the foldername) to the project.
28
-
Click Arduino in the menu bar, select "Add a library to the selected project" and select the "library" (folder) you created above (LibCodeDemo).
29
-
30
-

31
-
>If the library is not showing up.
32
-
Check wether the root folder is actualy a private library folder.
33
-
Check if you added the header file to your library.
34
-
35
-
Select Finish and your project should look something like:
Note the small arrow in the folder icon which indicates this is a linked folder.
40
-
41
-
**Drag and drop the class to the library folder**
42
-
Now simply drag and drop the header file and source code to the library folder.
43
-

44
-
45
-
That is all there is to it.
10
+
Here is what it looks like on my system:
11
+

12
+
13
+
**write your first version of the library code**
14
+
In most cases you will start by simply creating a class (right click the project and select new class) into an existing project.
15
+
Later you will decide that this class/code is worth to be upgraded to a library.
16
+
So we create a class in our project with the name of the library we want to create.
17
+

18
+
19
+
**Outside of eclipse: create a subfolder with the library name in one of your private library folders**
20
+
As I have C:\Users\jan\Documents\Arduino\libraries listed as a private Library; I created a folder in C:\Users\jan\Documents\Arduino\libraries with the name Libcodeclass.
21
+
Add a file with extension .h in the folder (I used findMe.h)
22
+

23
+
24
+
Note that it is a good practice to have the same name for the folder as for the header file (that is even with casing).
25
+
26
+
**Import the library into your project**
27
+
Because we created a "folder containing code" on disk the plugin can add the "library" (with the foldername) to the project.
28
+
Click Arduino in the menu bar, select "Add a library to the selected project" and select the "library" (folder) you created above (LibCodeDemo).
29
+
30
+

31
+
>If the library is not showing up.
32
+
Check wether the root folder is actualy a private library folder.
33
+
Check if you added the header file to your library.
34
+
35
+
Select Finish and your project should look something like:
0 commit comments