I am trying out my hand at creating a library. For my first library, I decided that a Pololu protocol handler was a good option - there exist here on the forums and elsewhere various bits of code and such, but no easy to use library interface.
For this library, I am targetting servos, mainly, as all I have is a Micro Serial Servo Controller:
...to work with. I can see the library being expanded to the motor controllers later, though.
I am basing my library on the following code from the forum (and I note this in my library - I'm always willing to give props where props are due!):
It seems the most complete (only missing a couple of configuration functions, which I am adding), at least for the MSSC, according to the documentation at Pololu.
I have a few questions, though, that I hope others who have more experience in this task can help me with:
Which Software Serial library should I support? I was initially going to use SoftwareSerial, but I have heard about several other options as well, some that are better. Is there a way to support more than one type of serial interface (I wouldn't mind writing the library to support both a software serial and hardware serial ports)?
In writing the library, I am following the tutorials found on the Arduino site; is there any other forms of standards, naming conventions, constants, comments, etc - that I should be aware of? I'm already using "camelCasing" on my methods - I just want to follow a standard if it already exists.
I think I have found possible solutions (that I have yet to try - hopefully tonight I will know), but last night when I was working on the library, compiling it was throwing an error about the SoftwareSerial library (I don't have any of this in front of me, so I am not asking for a solution here) - according to one of the tutorials you should delete the object file (.o) before recompiling the sketch (that may be my issue) - but does any one have good recommendations on how to use a software serial library in your own library (I must also note that I found this thread here - which may be my solution):
- When the coding is complete and verified working, where would be the best place to host the code for all to enjoy (I will probably release it LGPL)? Freshmeat? Google Code? My personal website? Just looking for some suggestions and experiences...
Well - that is all. I don't know if anyone else has worked on such a library; I am learning a lot by doing it myself, though, and I need it for the work I am doing on my UGV (Unmanned Ground Vehicle); ultimately it will be used to control a pan/tilt head for the vision system of the robot (leaving six open servo ports for future use).
Once I have a working version plus an example usage sketch, and the needed usage documentation in place, I do plan on releasing it for others here on the forums (likely placing it in the playground, and hosting it "whereever").
Thank you all in advance!