Downloading the Arduino IDE
First things first, let’s download the IDE from here. Please get the offline, desktop version instead of the web editor. For the Windows version, we recommend using the Windows Installer version rather than the zip file version unless you are proficient on the Windows platform.
Then unzip or run the .exe file (Windows) and follow the instructions to install.
Installing the USB Driver
The main way your PC and the FreakLabs board will communicate is via USB so it’s important to have a properly installed USB driver. For Windows and Mac systems, a specific driver will need to be installed. For Linux systems, the USB device will be recognized automatically by the OS so no driver is required.
NOTE: Do not install if you have the current macOS Mojave 10.14 or later. macOS Mojave 10.14 (released in October 2018) includes a CH34x driver by Apple. If you’re not sure, please verify your version of OS. If it’s 10.14 or higher, please skip this step initially and see if the device will automatically get recognized. We will go through this in a later step.
Arduino IDE Folder Structure
The Arduino IDE expects to see a specific folder structure regardless of platform. In all supported OSes, there’s a directory called Arduino that contains a /hardware, /libraries. and /sketches directory. On Windows, it’s in C:/user/XXXXX/Documents/Arduino where XXXXX is the username. On Linux, it’s in the home directory, ~/Arduino. On Mac OSX, its in ~/Documents/Arduino.
Arduino will automatically look for board definitions in the /hardware directory. Board definition files allow the Arduino IDE to recognise different hardware. The IDE needs to know the microcontroller and pin layout of a specific circuit board to ensure the board responds as expected when programmed using the IDE.
So a lot of things that happen “under the hood” take place in the /hardware directory also. Unless you’re an intermediate to advanced user, you usually won’t need to do much in the /hardware directory.
The /libraries directory is where all libraries are installed to.
A library is a collection of related pieces of code compiled and stored together in a single file. That file can be linked to, and referenced in application code, giving access to the functions in the library without having to write them all yourself.
If you use the built-in Arduino library manager to install libraries, they will appear here. If you want to check which libraries you have installed, you can also check that from the Arduino IDE in “Sketch/Include Library”.
You can also check directly in the /libraries directory. One issue with installing libraries from the Arduino library manager is that you can’t update the library unless a new version of that library is officially released. To get around this, you can just download the library directly and unzip it in the /libraries folder. You’ll need to restart Arduino so it can re-scan the libraries, but after that, it will be updated. We almost never use the Arduino library manager and manage our libraries manually via the /libraries folder.
Sketches are Arduino programs that are uploaded to the board to control it.
The /sketches directory maps to the “File/Sketchbook/sketches” menu item. File/Sketchbook actually maps to the root Arduino directory, but it’s generally considered good practice to have a separate directory for sketches. Otherwise, the root Arduino directory quickly gets cluttered and it may get hard to tell the difference between special Arduino directories and other sketch directories.
Now we’ve installed Arduino, let’s install the Freaklabs board definition files.