and output signals to control LEDs, motors,buzzers, and more. An Arduino board like the one in Figure 1-2 has all of the supporting components and circuitry to make a micro-controller work.
FIGURE 1-2: The Arduino Uno is an open source, programmable electronics platform for hobbyists.
The programming language used for the Arduino is essentially a version of C/C++. The programming environment is the
Arduino IDE (integrated development environment)
. The team that developed it bundled it with many prewritten functions and libraries to simplify the process of writing code to interface with hardware. For example, these libraries take the multiple lines of code required to turn on an LED and simplify them into a single instruction!
About the SparkFun RedBoard
There are many officially Arduino-branded boards, but since the platform is
open source
(meaning the source hardware design and software are available for anyone to look at and modify), there are also many Arduino derivatives, clones, and compatible boards. The board designs are all licensed under a Creative Commons Attribution Share-Alike license, and the Arduino FAQ (
https://www.arduino.cc/en/Main/FAQ
) states that anyone is “free to use and adapt [these designs] for your own needs without asking permission or paying a fee.” Derivative boards work with the same programming environment as an official Arduino, but often the hardware has been tweaked or modified in some way.
The SparkFun RedBoard, pictured in Figure 1-3 , is an Arduino-compatible derivative board. It is based on the Arduino Uno design but has a more stable USB interface and uses a USB mini connector instead of the Type-A connector. Otherwise, it is exactly the same as the Uno, with the same size and shape.
FIGURE 1-3: The Arduino-compatible SparkFun RedBoard. Notice how its shape matches up with the Arduino Uno in Figure 1-2 .
The RedBoard is the go-to Arduino board here at SparkFun and has a few key components that you’ll need to know in order to navigate the first few chapters of this book. We have labeled each term for you in Figure 1-3 .
ATmega328 microcontroller The square black chip in the middle of the board. It is the brain of the Arduino.
Header pins The tiny metal legs on the microcontroller, which let you read input and send output. They are accessible through the four sets of black headers on either side of the Arduino. They are numbered and labeled for specific uses. The pins you’ll care about most are those labeled
Digital
(0–13),
Analog In
(A0–A5), and
Power
.
Mini-USB port This is how you send code to and communicate with the Arduino. You can also power your board using the USB port for most applications in this book. If an external power supply is needed, we’ll be sure to point it out.
Power LED This LED is an indicator to show that the Arduino is powered on. If you ever have a short circuit on your board or a bad power connection, this indicator will not turn on.
TX/RX LEDs These LEDs blink when data, such as code or numbers, is being passed back and forth between your Arduino and your laptop.
Onboard LED 13 A debug light. If you’re plugging your Arduino in for the first time, LED 13 should blink once per second. It’s connected to pin 13 on the Arduino.
External power jack A barrel jack port next to the USB port. The Arduino takes 5 V of power, though you can safely supply the Arduino a voltage between 7 and 15 V without damaging your board. A chip on the Arduino scales this input voltage down to 5 V for the electronics and circuitry to work properly.
Like all Arduino-compatible boards, you’ll program the RedBoard with the Arduino IDE.
INSTALLING THE ARDUINO IDE AND DRIVERS
You should install the Arduino IDE before plugging your RedBoard into the USB port for the first time. To install the Arduino IDE, go to
http://www.arduino.cc/download/
. Select the appropriate version for your computer’s operating system, and click the link to download ( Figure 1-4
Richard Ellis Preston Jr.