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
Copy file name to clipboardExpand all lines: website/WebContent/fragments/how_to/create_a_library.md
+12-8Lines changed: 12 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -8,43 +8,47 @@ With Sloeber you have a real development environment which allows you to modify
8
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
10
Here is what it looks like on my system:
11
-

11
+
<imgsrc="http://eclipse.baeyens.it/img/lib_demo_1.PNG"alt="freshly created sketch in empty workspace"height="400"width="600">
12
+
12
13
13
14
**write your first version of the library code**
14
15
In most cases you will start by simply creating a class (right click the project and select new class) into an existing project.
15
16
Later you will decide that this class/code is worth to be upgraded to a library.
16
17
So we create a class in our project with the name of the library we want to create.
17
-

18
+
<imgsrc="http://eclipse.baeyens.it/img/lib_demo_2.PNG"alt="My first lib class"height="400"width="600">
18
19
19
20
**Outside of eclipse: create a subfolder with the library name in one of your private library folders**
20
21
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
-

22
+
Add a file with extension .h in the folder (I used findMe.h)
23
+
<imgsrc="http://eclipse.baeyens.it/img/lib_demo_3.PNG"alt="Create a llibrary placeholder"height="400"width="600">
23
24
24
25
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
26
27
**Import the library into your project**
27
28
Because we created a "folder containing code" on disk the plugin can add the "library" (with the foldername) to the project.
28
29
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
30
-

31
+
<imgsrc="http://eclipse.baeyens.it/img/lib_demo_4.png"alt="Add the library to your project" >
32
+
31
33
>If the library is not showing up.
32
34
Check wether the root folder is actualy a private library folder.
33
35
Check if you added the header file to your library.
34
36
35
37
Select Finish and your project should look something like:
0 commit comments