MorganS:
You can distribute an Arduino library without the source code. This is more common in C libraries in commercial programming. I've never seen an Arduino library like this.
If you don't want people stealing your code then don't give it to them. Sell them hardware that is already programmed.
Not so fast....
Even if you sell a h/w type device with a pre-loaded f/w image. That doesn't necessarily allow you to close all your source code if you are using other open source in your project.
If you used Arduino and arduino libraries to develop your f/w image, you are still subject to all the licensing terms of all the other code and libraries used by the sketch in the linked image.
Some Arduino library code it licensed GPL 3.0 which precludes you from using any closed source in the project/product.
Even when using LGPL 2.1 (which is what most of the Arduino library code is), there are still some hefty restrictions.
Sure LGPL 2.1 does not mandate opening your own source, but it you must still conform to section 6 of the LGPL license agreement for all the LGPL 2.1 code used in the linked image.
Yes you can provide objects only for your sources rather than the source code; however,
due to Arduino being a f/w environment without shared libraries, you will have to conform to 6a
a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
The most important thing to take note of is that if you choose to not provide all the source code and instead provide only pre-compiled objects, you must still provide a way for the user to be able to update/replace/modify any of the LGPL 2.1 code that was used in the image.
This is next to impossible to comply with in the Arduino environment unless you release all the source code so that the user can rebuild and upload the new image to the device.
Even if you don't use any Arduino libraries, or even totally avoid Arduino all together and just wrote all your own code using gcc, you would still likely have 6a requirements since the compiler would end up pulling in some amount of gcc LGPL library code like the startup code or some isr wrappers, or stack frame code, math code, etc...
So you would still have to provide a way for user to be able to rebuild the image, using your pre-compiled objects and update the device.
--- bill