![]() ![]() If you have multiple interface types for your library (say I2C and Serial) consider adding subfolders with examples demonstrating the different library methods using the different interfaces. Fewer people will need the AdvancedI2C or TwoSensors examples. Note that the complexity of the examples should advance. This will make it obvious to the user where to begin (i.e. Use escalating examplesĬreate your examples with the naming convention “Example1_BasicReadings”, “Example2_SetReadRate,” etc. A library should have an example of most, if not all, of the methods in the class. If the user has no other documentation they should be able to use almost all the features of a device by going through all the examples. Read the Arduino style guide to give you a starting point for your examples. ![]() Read and follow the Arduino Style Guide for writing examples Be sure you are being as kind to the user as possible with your library. The Arduino API Style Guide is a great starting point to make users feel comfortable with your library as well as XYZ library. Read and follow the Arduino API Style Guide for writing libraries Please consider them the next time you write a library. This is a compiled list of lessons we've learned along the way that can make a good Arduino library great. While (1 < Wire.SparkFun has written a large number of libraries for Arduino over many years. This make the communication not byte to byte controlled as I want it to be for my need. I realized that if I wanted to make an Arduino slave, when receiving from master, it actually reads from a buffer that is already previously received. But let’s start with the problem found in the Wire. When the limitations were somehow fixed, even though the small number of modifications (it is somehow a sort of hacking of the library) I found that the my final result were so useful to me that I thought was worth to write a short article about it. ![]() Then, when experimenting with a portability of a project in the Arduino environment, I started to trying the official Wire library, discovering some incompatibilities for my needs. I have spent a lot of time on playing and later working on the I2C buses. I almost always used self developed libraries, both for learning and job requirement purposes. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |