Book Image

C Programming for Arduino

By : Julien Bayle
Book Image

C Programming for Arduino

By: Julien Bayle

Overview of this book

Physical computing allows us to build interactive physical systems by using software & hardware in order to sense and respond to the real world. C Programming for Arduino will show you how to harness powerful capabilities like sensing, feedbacks, programming and even wiring and developing your own autonomous systems. C Programming for Arduino contains everything you need to directly start wiring and coding your own electronic project. You'll learn C and how to code several types of firmware for your Arduino, and then move on to design small typical systems to understand how handling buttons, leds, LCD, network modules and much more. After running through C/C++ for the Arduino, you'll learn how to control your software by using real buttons and distance sensors and even discover how you can use your Arduino with the Processing framework so that they work in unison. Advanced coverage includes using Wi-Fi networks and batteries to make your Arduino-based hardware more mobile and flexible without wires. If you want to learn how to build your own electronic devices with powerful open-source technology, then this book is for you.
Table of Contents (21 chapters)
C Programming for Arduino
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Installing Arduino drivers


Arduino boards provide an USB interface. Before we plug the USB cable and link the board to our computer, we have to install specific drivers in the latter.

There is a huge difference between Windows and OS X here; basically, OS X doesn't require any specific drivers for Arduino Uno or even Mega 2560. If you are using older boards, you'd have to download the latest version of drivers on the FTDI website, double-click the package, then follow instructions, and finally, restart your computer.

Let's describe how it works on Windows-based systems, I mean, Windows 7, Vista, and XP.

Installing drivers for Arduino Uno R3

It is important to follow the steps mentioned next to be able to use the Arduino Uno R3 and some other boards. Please check the Arduino website for up-to-date references.

  1. Plug your board in and wait for Windows to begin the driver installation process. After a few moments, the process fails.

  2. Click on the Start menu, and open Control Panel.

  3. In Control Panel, navigate to System and Security. Next, click on System. Once the System window is up, open Device Manager.

  4. Look under Ports (COM & LPT). Check the open port named Arduino UNO (COMxx).

  5. Right-click on the Arduino UNO (COMxx) port and choose the Update Driver Software option.

  6. Next, choose the Browse my computer for driver software option.

  7. Finally, navigate and select the Uno's driver file, named ArduinoUNO.inf, located in the Drivers folder of the Arduino software download (be careful: not the FTDI USB Drivers subdirectory).

  8. Windows will finish the driver installation from there and everything will be fine.

Installing drivers for Arduino Duemilanove, Nano, or Diecimilla

When you connect the board, Windows should initiate the driver installation process (if you haven't used the computer with an Arduino board before).

On Windows Vista, the driver should be automatically downloaded and installed. (Really, it works!)

On Windows XP, the Add New Hardware wizard will open:

  1. When asked Can Windows connect to Windows Update to search for software? select No, not this time. Click on Next.

  2. Select Install from a list or specified location (Advanced) and click on Next.

  3. Make sure that Search for the best driver in these locations is checked, uncheck Search removable media, check Include this location in the search, and browse to the drivers/FTDI USB Drivers directory of the Arduino distribution. (The latest version of the drivers can be found on the FTDI website.) Click on Next.

  4. The wizard will search for the driver and then tell you that a USB Serial Converter was found. Click on Finish.

  5. The new hardware wizard will appear again. Go through the same steps and select the same options and location to search. This time, a USB Serial Port will be found.

You can check that the drivers have been installed by opening Windows Device Manager (in the Hardware tab of the System control panel). Look for a USB Serial Port in the Ports section; that's the Arduino board.

Now, our computer can recognize our Arduino board. Let's move to the physical world a bit to join together the tangible and intangible worlds.