Skip to content

Install the Arduino IDE

Richard Goodwin edited this page Oct 2, 2021 · 14 revisions

Manually install the Arduino IDE

Do not use atp-get to install the Arduino IDE, or you will end up with a very ancient version - some sort of licensing issue with raspberrypi.org prevents them from including the latest version in the apt-get library. Instead, do the following:

Point the Pi web browser at:

https://www.arduino.cc/en/Main/Software

In the right-hand panel, click on the Linux ARM download link. Once it has downloaded, open a teminal window and navigate to

cd ~/Downloads

Check the name of the tarball that has been downloaded, as you'll need to refer to it next:

pi@raspberrypi:~/Downloads $ tar xvf arduino-1.8.5-linuxarm.tar.xz     

This will decompress it into a directory called something like arduino-1.8.5 change to that directory and run the install script

cd arduino-1.8.5
sudo ./install.sh

Edit the ArduinoIDE Preferences file to specify the output location for compiled .hex files.

The exact path to the preferences.txt file you need to edit can be found by starting the Arduino IDE, then clicking on File -> Preferences and towards the bottom there will be a line that says

more preferences can be edited directly in the file

then the full path to it will be listed.

first close the Arduino IDE then open that file in a editor:

sudo nano /home/pi/.arduino15/preferences.txt

Add the following line (may as well keep it in alphabetical order) this is where the Arduino IDE will write the compiled.hex files:

build.path=/home/pi/build

Add the Adafruit VL6180x library

Sketch->Include Library->manage Libraries

Type VL6180x in the "filter your search" box

Find the Adafruit library in the list, select the most recent version from the drop-down list on the right-hand side, then click Install/

Add the mcp4728 library

This is available from a number of places on the web, including:

http://code.google.com/p/neuroelec/downloads/detail?name=mcp4728_library-v1.3.zip
https://github.com/BenoitSchillings/mcp4728

Simplest is to clone the github version:

git clone https://github.com/BenoitSchillings/mcp4728.git

Find the location of the Arduino IDE local libraries by:

* Open the Arduino IDE and click on File -> Preferences
* Note the Sketchbook Location path (eg /home/pi/Arduino)
* Close the Arduino IDE

You then need to copy the mcp4728 directory including the mcp4728.h and mcp4728.cpp files to the Arduino IDE Libraries folder.

When you re-open the Arduino IDE, make sure that, in the Sketch -> Include Library that the following two libraries are listed towards the bottom:

Adafruit_VL6180x
mcp4728

you do not need to add these to the project. That happens because they are included in the code

Set the board type to Arduino Nano

Tools->Board:  click on Arduino Nano in the list

Next: Compile and upload the sketch