MySQL for the Internet of Things

(Steven Felgate) #1
ChApTEr 2 ■ hArdwArE for IoT SoluTIonS

Arduino Tutorial


This section is a short tutorial on getting started using an Arduino. It covers obtaining and installing the
IDE and writing a sample sketch. Rather than duplicate the excellent works that precede this book, I cover
the highlights and refer readers who are less familiar with the Arduino to online resources and other books
that offer a much deeper introduction. Also, the Arduino IDE has many sample sketches that you can use to
explore the Arduino on your own. Most have corresponding tutorials on the http://arduino.cc site.


Learning Resources


A lot of information is available about the Arduino platform. If you’re just getting started with the Arduino,
Apress offers an impressive array of books covering all manner of topics concerning the Arduino, ranging
from getting started using the microcontroller to learning the details of its design and implementation.
The following is a list of the more popular books:



  • Beginning Arduino by Michael McRoberts (Apress, 2010)

  • Practical Arduino: Cool Projects for Open Source Hardware (Technology in Action) by
    Jonathan Oxer and Hugh Blemings (Apress, 2009)

  • Arduino Internals by Dale Wheat (Apress, 2011)


There are also some excellent online resources for learning more about the Arduino, the Arduino
libraries, and sample projects. The following are some of the best:



The Arduino IDE


The Arduino IDE is available for download for the Mac, Linux (32- and 64-bit versions), and Windows
platforms. You can download the IDE from http://arduino.cc/en/Main/Software. There are links for each
platform as well as a link to the source code if you need to compile the IDE for a different platform.
Installing the IDE is straightforward. I omit the actual steps of installing the IDE for brevity, but if you
require a walk-through of installing the IDE, you can follow the Getting Started link on the download page or
read more in Beginning Arduino by Michael McRoberts (Apress, 2010).


■Tip See http://arduino.cc/en/Guide/Howto if you need help installing the drivers on windows.


Once the IDE launches, you see a simple interface with a text editor area (a white background by
default), a message area beneath the editor (a black background by default), and a simple button bar at the
top. The buttons are (from left to right) Compile, Compile and Upload, New, Open, and Save. There is also
a button to the right that opens the serial monitor. You use the serial monitor to view messages from the
Arduino sent (or printed) via the Serial library. You will see this in action in your first project. Figure 2-13
shows the Arduino IDE.

Free download pdf