Fundamentals

Setting Up The Arduino IDE

Mike Lewis

Issue 17, November 2018

While we realise this is a rather basic topic, it’s been requested on numerous occasions. So here it is. Setting up Arduino IDE on different platforms!

The folks at Arduino CC make life pretty easy for everyone, and getting your Arduino IDE isn’t terribly difficult. However, after a good number of requests, and in line with our Kid’s Basics concepts, we thought we’d run a small guide to getting running on Arduino IDE, regardless of your platform.

If you haven’t heard the term “IDE” before, it stands for Integrated Development Environment. It includes all the software and tools required to develop code for hardware and software applications in all sorts of industries, and with all sorts of hardware.

In this context, the IDE is specific to Arduino. This means that there’s very little configuration of the software, but a few key steps can still trip you up if you’re not familiar. We’ll cover setting it up on a Raspberry Pi, a Windows computer, and on Mac OS. Some steps are common regardless of your operating system.

We’ll then look at setting up your board and getting your first sketch running. These steps are fairly straightforward, but we understand how new users can be caught in various steps.

Arduino Desktop IDE

The offline desktop IDE is available for Windows, Mac OS X, and Linux. There is now an online IDE available, which we'll cover next month. However there's a host of reasons to use the offline IDE, including while travelling without Internet.

INSTALLING ARDUINO IDE

First, use your favourite web browser to head over to https://www.arduino.cc/en/Main/Software then follow the guides below for your operating system.

Installation on Raspbian (Raspberry Pi)

Select Linux ARM and download the file package.

Once the file has downloaded, right click and select Extract To. Choose your preferred location keeping in mind that the program will be executed from this directory.

Next, navigate to the extracted directory and open the install.sh file then click 'Execute in Terminal'

The Arduino IDE should now be installed and you should see a shortcut on the desktop.

Installation on Windows

Select Windows Installer and download the executable file.

Run the file once it has finished downloading to start the installation wizard and accept the default settings.

Once the installation is complete, you should have a shortcut for Arduino on the desktop.

Installation on Mac OS

Select Mac OS X and Download the zip package.

Once downloaded, double-click the zip file to extract.

Drag the extracted application into your applications directory. (This step is optional)

Now the application is ready to be executed.

SETTING UP YOUR BOARD

You should now have the Arduino IDE installed but before you can upload your first sketch, you’ll need to connect and configure your board. There are small differences in the various Arduino boards available, so the software needs to know what it’s communicating with, and how it’s communicating with it.

Connect your board into your Computer/Pi using the appropriate USB cable.

Next, we will configure the board type and port. Open the Arduino IDE and select Tools › Board and select your board type. You should be able to match your board name (eg UNO) with one on the list.

After you’ve selected your board, the next step is to select the port that your board is using. Navigate to Tools › Port and select the appropriate port. If this is not showing for you then you will most likely need to troubleshoot the connection between your Arduino device and the computer. USB is by far the simplest way to programme your Arduino.

If you’re following this guide with a Bluetooth enabled board, you should save that for after you’ve completed these steps as it can require further troubleshooting when it doesn’t work.

Finally, we can test that the Arduino IDE can communicate successfully with our board by selecting Tools › Get Board Info. You should see a board name fairly close to what you’ve connected and some other information.

It’s worth noting that some non-genuine hardware will report differently to what is expected. This is not generally an issue, however, when you try and compile your code, the IDE may assume your hardware has certain capabilities it doesn’t. This can cause erratic or unpredictable behaviour in your hardware.

Boards Manager

Arduino IDE works out of the box with commonly used boards, if however your board is not listed here then you will need to install the additional board. This is relatively painless simply select Tools › Boards › Boards Manager. From the Boards Manager search and find your board, hover your mouse over it and an install button will appear.

In some cases, you may still not find your board listed in the Boards Manager. In this case please follow your vendor’s instruction for adding your board. It usually requires adding an additional Boards Manager URL in the Arduino IDE Preferences menu.

RUNNING YOUR FIRST SKETCH

A good place to start is by using the Blinking LED sketch that is included with the Arduino IDE. This example sketch makes use of the onboard LED that most Arduino and Genuino boards have. If you’d prefer to run this example with an external LED simply follow the guide at https://www.arduino.cc/en/tutorial/blink

Navigate to File › Examples › 01.Basics › Blink.

Now click the Upload button. That’s it! If all went well you should see a “Done Uploading” message and the onboard LED should start blinking.

INSTALLING ADDITIONAL LIBRARIES

Libraries are external chunks of code, which generally make it easier to perform certain functions, or integrate with specific hardware in a simpler way. This may be something as simple as a servo motor, or as complex as a touchscreen or other interface device. Without libraries, you would have to write complex code each time, or at least include supplied code in your main Arduino sketch.

Libraries, therefore, help keep everything compartmentalised and your own sketch a little cleaner to work with. It also means hardware vendors can more easily provide code to an end-user, without any complex integration to the main sketch required.

There are multiple ways to install a Library using the Arduino IDE:

  • Library Manager
  • Add .ZIP Library Feature
  • Manual installation

Library Manager

To access the Library Manager, navigate to Sketch › Include Library › Manage Libraries.

From here, you will be able to find additional Libraries to install or manage the libraries that are already installed.

Add .ZIP Library

If you have a Zip file containing a library you can install it by selecting Sketch › Include Library › Add .ZIP Library.

Manual Installation

If you prefer manual installation you can simply drop a library directory (ensuring that its unzipped) into your sketchbook folder then restart the Arduino IDE.

You can discover the location of your sketchbook folder by Navigating to File › Preferences or Arduino › Preferences

The default locations are:

Mac OS X: /Users//Documents/Arduino/libraries

Linux: /home//Arduino/libraries

Windows: C:UsersDocumentsArduinolibraries

After the IDE has restarted go to Sketch › Include Library and select the library that you installed. This will add the include line into your current sketch.

WHERE TO FROM HERE?

This should get you up and running on the basics of the Arduino IDE, getting a board configured, and adding libraries as required for additional hardware. We’ll continue expanding on these topics over coming months.

Arduino IDE contains many examples which can be run on an Arduino UNO with minimal (sometimes zero) additional hardware. However, if you’re really just getting started, there are a number of great experimenters kits available. They include some basic hardware to further explore the principles and concepts to get the most out of your Arduino.

Reading & Resources: