Skip to content

Commit 82603ce

Browse files
author
jantje
committed
The last ones of #1022
1 parent e026c8e commit 82603ce

File tree

7 files changed

+45
-45
lines changed

7 files changed

+45
-45
lines changed
Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
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**
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**
99
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-
![freshly created sketch in empty workspace](http://iloapp.baeyens.it/data/_gallery/public/1/152062477075274500_resized.png?width=750&height=480)
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-
![My first lib class](http://iloapp.baeyens.it/data/_gallery/public/1/152062566341147200_resized.png?width=750&height=380)
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-
![Create a llibrary placeholder](http://iloapp.baeyens.it/data/_gallery/public/1/152062566836976100_resized.png?width=750&height=380)
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-
![Add the library to your project](http://iloapp.baeyens.it/data/_gallery/public/1/152062391251108300_resized.png?width=750&height=480)
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:
36-
37-
![a empty library folder](http://iloapp.baeyens.it/data/_gallery/public/1/152062645306058800_resized.png?width=750&height=380)
38-
Do not forget to delete the findMe.h file.
39-
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-
![we are done](http://iloapp.baeyens.it/data/_gallery/public/1/152062664041588100_resized.png?width=750&height=480)
44-
45-
That is all there is to it.
10+
Here is what it looks like on my system:
11+
![freshly created sketch in empty workspace](http://eclipse.baeyens.it/img/lib_demo_1.png?width=750&height=480)
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+
![My first lib class](http://eclipse.baeyens.it/img/lib_demo_2.png?width=750&height=380)
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+
![Create a llibrary placeholder](http://eclipse.baeyens.it/img/lib_demo_3?width=750&height=380)
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+
![Add the library to your project](http://eclipse.baeyens.it/img/lib_demo_4.png?width=750&height=480)
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:
36+
37+
![a empty library folder](http://eclipse.baeyens.it/img/lib_demo_5.png?width=750&height=380)
38+
Note the small arrow in the folder icon which indicates this is a linked folder.
39+
40+
**Drag and drop the class to the library folder**
41+
Drag and drop the header file and source code to the library folder.
42+
Do not forget to delete the findMe.h file.
43+
![we are done](http://eclipse.baeyens.it/img/lib_demo_6.png?width=750&height=480)
44+
45+
That is all there is to it.
4646

4747
>IMPORTANT Your library code is now no longer in your workspace!!
4848
@@ -52,4 +52,4 @@ That is all there is to it.
5252
**Party success**
5353

5454
1. drink a beer
55-
2. [Become a patron of jantje](http://eclipse.baeyens.it/donate.html "thanks")
55+
2. [Support jantje](http://eclipse.baeyens.it/donate.html "thanks")

website/WebContent/img/lib_demo_1.PNG

96.3 KB
Loading

website/WebContent/img/lib_demo_2.PNG

140 KB
Loading

website/WebContent/img/lib_demo_3.PNG

95.1 KB
Loading

website/WebContent/img/lib_demo_4.png

24.6 KB
Loading

website/WebContent/img/lib_demo_5.PNG

145 KB
Loading

website/WebContent/img/lib_demo_6.PNG

138 KB
Loading

0 commit comments

Comments
 (0)