
Posted in Arduino Hacks Tagged arduino, Arduino libraries, sparkfun Post navigation Sometimes it makes sense to port something over instead of starting from scratch. Of course, you also need a great idea for a library or an improved library that doesn’t already exist. If you add their advice to the official style guide, you should be well on your way to creating really great Arduino libraries. For example, the use of default parameters and the order of parameters. However, a lot of the advice is very subtle but important. In the old days, writing terse code might lead to higher efficiency, but with modern compilers, you ought to get a tight final result even when doing things in a pretty verbose fashion. They also suggest making code as readable as possible, which is usually good advice.
#Arduino libraries not working serial
For example, they always use the serial port at 115,200 baud, but they do note that 9,600 baud is also popular.

Of course, as you might expect, some of this is a matter of opinion, and admits that. There is an official style guide, but a recent post by from Sparkfun points out lessons learned from writing more libraries than most people.

Writing a great library that everyone can easily use takes a little forethought. On the other hand, it is also an ecosystem in which many different boards and libraries can be supported.

On the one hand, it is a simple environment where you can just pick and choose a few libraries, write a few lines of code, and make lots of interesting things. The Arduino IDE has a bit of a split personality.
