Exporting libraries with your code

Hi,

I am new to the arduino world so I am sorry about this simple question.

I am developing code for a syringe pump using a stepper motor. I am currently using the AccelStepper library to accomplish this.

Once I finish coding, I need to send the code to my assistant, or anyone for that matter, so that he can easily implement the code for his own arduino syringe pump. He does not have the AccelStepper library in his arduino. When I export the code and send it to him, can he use the code even though he does not have the library pre-installed? If not, how could I bundle the Library with my code so that anyone can just easily open my code and instantly use it for themselves without the hassle of downloading the accelstepper library?

Thank you

When I export the code and send it to him, can he use the code even though he does not have the library pre-installed?

Not of he is going to compile the code. Is that what is intended ?

You could put the library files in the same folder as the sketch, change the format of the #includes to use " instead of < and > and zip up the complete directory. The library files will then be compiled along with the program but will not be accessible by other programs if that is important.

In a generic C++ environment this would be done with a "tar" or zip file, with all the relevant files in a directory tree structure. An Arduino library folder can be in the same folder as your sketch folder. You might have to change some include statements. Then zip the whole thing.

So, to clarify, I should put the AccelLibrary folder and my code in the same folder. At the top of my code it should say #include "AccelStepper.h". Then I can zip it all together. Then once I send it off, and my friedn unzips it and opens it, it should work. Does he have to open it a certain way or save it a certain way? Do i have to save it a certain way. Sorry, I have never exported or imported code in arduino.

ppatricklydonn:
So, to clarify, I should put the AccelLibrary folder and my code in the same folder. At the top of my code it should say #include "AccelStepper.h". Then I can zip it all together. Then once I send it off, and my friedn unzips it and opens it, it should work. Does he have to open it a certain way or save it a certain way? Do i have to save it a certain way. Sorry, I have never exported or imported code in arduino.

The first part is all correct. The details of tranferring it depend on the compression/archiving utility that you use. Most of them default to saving a directory tree, so you should be okay. But the end result must be a sketch folder inside the user's "Arduino" sketch folder.

Keep in mind that any online updates to the library will be overlooked.

ppatricklydonn:
So, to clarify, I should put the AccelLibrary folder and my code in the same folder. At the top of my code it should say #include "AccelStepper.h".

No, that won't work, you would need to specify the path to AccelStepper.h in the include statement. Here's my advice:

Folder structure (assuming sketch is named SyringePump):

SyringePump
|_SyringePump.ino
|_src
|_AccelStepper

And the include statement:

#include "src/AccelStepper/AccelStepper.h"