user7728: I have written a library for Arduino, my_library, consisting of my_library.h and my_library.cpp, both included in my_library folder. Actually the library is recognized from IDE Arduino and works fine.
I want to add some examples, let's say Example1 and Example2. How is that possible?
Should the examples be included in my_library folder?
or should be included in another folder inside my_library folder?
I tried several combinations but none worked. Do I miss something?

user4143: You need to create a folder called "examples" in your library folder. Within there, each in its own folder, you place your examples.
For example:
MyLib/
MyLib/MyLib.h
MyLib/MyLib.cpp
MyLib/examples/
MyLib/examples/Example1/
MyLib/examples/Example1/Example1.ino
MyLib/examples/Example2/
MyLib/examples/Example2/Example2.ino

Be sure to name the example's folder the same as the name of the example.

7728: <p>I have written a library for Arduino, <code>my_library</code>, consisting of <code>my_library.h</code> and <code>my_library.cpp</code>, both included in <code>my_library</code> folder. Actually the library is recognized from IDE Arduino and works fine.</p>

<p>I want to add some examples, let's say <code>Example1</code> and <code>Example2</code>. How is that possible?</p>

<p>Should the examples be included in <code>my_library</code> folder?</p>

<p>or should be included in another folder inside <code>my_library</code> folder?</p>

<p>I tried several combinations but none worked. Do I miss something?</p>
 4143: <p>You need to create a folder called "examples" in your library folder. Within there, each in its own folder, you place your examples.</p>

<p>For example:</p>

<pre><code>MyLib/
MyLib/MyLib.h
MyLib/MyLib.cpp
MyLib/examples/
MyLib/examples/Example1/
MyLib/examples/Example1/Example1.ino
MyLib/examples/Example2/
MyLib/examples/Example2/Example2.ino
</code></pre>

<p>Be sure to name the example's folder the same as the name of the example.</p>
