your computer. There is one option if you have Mac OS X 10.3 (Panther) to 10.8 (Mountain Lion) and another option if you have Mac OS X 10.9 (Mavericks) or greater.
FIGURE 1-9: SparkFun FTDI Installation Guide
Download the appropriate driver and double-click it to start the installation process. You should be greeted with the familiar Mac software install window. Select your hard drive once it is found, and click OK . Continue through the installation process, and when the progress bar fills up (as in Figure 1-10 ), the drivers should be installed.
FIGURE 1-10: Installation of the FTDI drivers on OS X
That’s it! Now, double-click the Arduino icon in your
Applications
folder to run the IDE. If you’ve already opened the IDE before installing the FTDI drivers, you’ll need to fully exit and close out of the Arduino IDE and restart it for your serial ports to show up correctly.
NOTE
If you encounter an error after driver installation, check out solutions at
https://www.sparkfun.com/macdriver/
.
Installing on Linux
Arduino is available for Linux users, too. Download the correct Linux file for your system; it comes in 32- and 64-bit flavors. Then, uncompress the file using xz-utils or another file compression utility. If you want to use the latest version of Arduino in Linux, you may need to install some other dependency programs as well. Go to
http://playground.arduino.cc/Learning/Linux/
for distribution-specific information on this.
For most distributions of Linux (including Ubuntu, Debian, and Fedora), you should be able to use the apt-get package manager to install Arduino from the command line. Open a terminal and enter the following command:
sudo apt-get install arduino
Once the process is complete, open the Arduino program you just installed. Arduino uses Java to run the IDE and must be run out of an XWindows or comparable window user interface environment.
NOTE
Depending on the package manager for your distribution of Linux, the version you install this way may not be the latest version currently hosted on the Arduino site.
A BRIEF IDE TOUR
The IDE is a place for you to write instructions for your Arduino and test them out. These instructions form a program, or in Arduino terminology, a
sketch
. The IDE allows you to
upload
your sketch to your Arduino and control things in the physical world.
If you haven’t done so already, open your newly installed Arduino program. After a splash screen, you should see the IDE, which looks something like Figure 1-11 .
FIGURE 1-11: The Arduino IDE
You can use the menu bar (which consists of File, Edit, Sketch, Tools, and Help menus) ➊ to open or save files, upload your code to the Arduino, modify settings, and so on. You should also see a set of graphic buttons ➋ . In order from left to right, these are Verify/ Compile, Upload, New, Open, and Save. We will explore those menus and buttons throughout this book. The majority of the IDE is whitespace ➌ ; this is where you’ll write your code. Underneath thecode area is the
alert bar
➍ , and below it you’ll find the console ➎ ; these report statuses, alerts, and errors. For example, if there’s a typo in your sketch (called a
syntax error
), the IDE will show you the error there. If you try typing your name in the code window and click the check mark (Verify/Compile) button, the Arduino IDE will think for a bit and then show an error in the alert bar, highlight your name, and give you more information in the console about the error, as you can see in Figure 1-12 .
FIGURE 1-12: A typical error message and readout in the Arduino IDE
CHANGING THE DEFAULT PREFERENCES
Arduino is a fully open and configurable programming environment. There are a few minor things we like to tweak in the preferences to make it easier to write code, debug, and make cool stuff. Select File ▸ Preferences to view and change the general settings of the Arduino IDE. You should see a window similar to Figure 1-13 .
We suggest
Laurice Elehwany Molinari