IoT Zone is brought to you in partnership with:

I'm a 24 year old programmer, originally from Maine. I'm most proficient in Java and Python, but love learning about all languages, frameworks, etc. You can find more about me on my about.me site, http://about.me/nicholasdunn or on my blog, http://developmentality.wordpress.com/ . Nicholas has posted 1 posts at DZone. View Full User Profile

Arduino Cookbook - A Review

06.23.2011
| 6301 views |
  • submit to reddit
Published by: O'Reilly
ISBN: 0596802471

Reviewer Ratings

Relevance:
5

Readability:
4

Overall:
4

Buy it now

One Minute Bottom Line

Arduino is an open-source hardware and software platform for rapid prototyping. It lowers the barrier to entry for people who wish to dabble in the fusion of hardware and software but who might not be an expert in either realm. Arduino Cookbook is a great reference for anyone new to the Arduino platform, providing many examples from which to draw inspiration. Even an experienced programmer will find new things to learn from this book.

Review

Background

I have always been interested in technology, which is why I became a computer programmer. I’ve been tinkering with different programming languages for most of my life, but have seriously been programming for the past six years. Over all this time I’ve had limited experience with hardware. I have soldered cables for a TV production company and participated in a robotics team, but I never learned how circuits worked or how to interact with sensors and other hardware platforms. When I heard about the Arduino platform and saw examples of the way people are able to combine software and hardware into useful projects, I knew I had to get one. Arduino is the perfect platform for someone who is interested in technology but wants a low barrier to entry. Arduino Cookbook is a great first book for someone like me who knows how to program but does not know all of the various hardware sensors and circuits that are necessary to utilize the Arduino to the fullest extent.

Review

Like all books in the cookbook series, the Arduino Cookbook offers “recipes”, in which the author presents a problem, details a solution, and then offers additional discussion and references for more information.

True to the author’s claim that no prior software experience is required, the book starts with how to download and install the Integrated Design Environment (IDE) for creating Arduino sketches (programs) and uploading them to the board. Margolis then goes on to explain basic programming constructs such as loops, conditionals, etc. I was impressed by the author’s thoroughness in this regard. When discussing boolean values, he notes that true, HIGH, and 1 all mean the same thing, but that certain forms are more appropriate than others depending on the situation. For instance, it is more readable to say digitalWrite(pin, HIGH) than to say digitalWrite(pin, true), but that the reader might find any or all of these forms in sketches online. This is just one example in which the author shows the correct way to do something but then notes alternate ways in which they might be done “in the wild”, so that the reader is not confused when reading others’ code.

I appreciated that Margolis presented many software libraries that one can leverage in his projects rather than trying to roll his own, including a Twitter library, a software serial library, and string manipulation libraries. New programmers should absolutely get into the habit of checking if a software solution exists that they can pull into their project rather than writing it from scratch, and the author does a great job of encouraging this practice. He also shows how you can create your own library and share it with others. Given the importance placed on software libraries, I was a little surprised that the section on installing libraries was near the end of the book. Perhaps this is just the nature of the cookbooks that one must jump around to find all the relevant information, but for someone reading it from cover to cover like I did, it is a little annoying.

One section of the book that is very useful is Advanced Coding and Memory Handling, in which Margolis starts by describing what happens under the hood in the IDE to translate the simplified programming language in which Arduino sketches are written into standard C++. He then goes on to detail ways to deal with sketches that take too much memory to fit onto the Arduino board. Two great articles to supplement this material are Advanced Arduino Hacking and Create Your Own Arduino IDE

The real meat of the book for someone like me is all of the chapters on hardware interaction and manipulation. The book is very comprehensive in this regard, detailing among other things serial communications, digital and analog input, various sensors, the use of LEDs and LCDs, speakers, servos, motors, and accelerometers. I found it very useful that Margolis includes actual part names and numbers in many of the recipes dealing with hardware, as it makes it easy to replicate what he has created in his recipe.

As with any technical book, it is important to read the errata. I found a few mistakes in the advanced copy I received that would leave a new programmer very confused; fortunately they have been rectified on the errata page.

Overall I really enjoyed this book. The recipes presented introduced me to new hardware concepts and devices I had never heard of before, and the projects inspired me to build new things with the Arduino.

Published at DZone with permission of its author, Nicholas Dunn.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)