1

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?

asked Jul 4, 2016 at 11:46

1 Answer 1

4

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.

answered Jul 4, 2016 at 12:54
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.