5. Getting started with Arduino IDE

The Arduino IDE is a really simple programming environment. Arduino projects are called “sketches”. Main features of Arduino IDE are:

5.1. Simple GUI with only a few Menus and Buttons

../../../_images/arduino-menu.png

Fig. 5.13 Arduino GUI Overview

  • The first button starts the compilation of your program.

  • The second button compiles and downloads the program to the board.

  • The next three buttons are New, Open and Save.

  • On the right side is the button for the serial monitor.

5.2. Managed and unmanaged Libraries

The Arduino project provides a lot of libraries which are version managed. These libraries are available via the Library Manager in the Sketch menu.

../../../_images/arduino-librarymanager.png

Fig. 5.14 Arduino Library Manager

With the Library Manager you can search for libraries and install them. Also library updates can be installed with this tool.

Unmanaged, own or third party libraries are supported as well. These can be placed in the user folder.

..\Documents\Arduino\libraries\

After adding a new library into this folder, a restart of the IDE is necessary.

5.3. Serial monitor and Serial plotter

With the serial monitor you have a direct access to the serial port. Via serial port you can exchange information between the developer and the program running on the board. It is mostly used for debugging software or exchanging data between a pc program and the Arduino board.

The serial plotter is a really simple tool which is able to plot a received number in a time series diagram. You can plot multiple values into one waveform, by adding a blank between the values. If you use a tabulator \t as separator the values are plotted in different waveforms.

5.4. Examples

Most Board Support Packages and Libraries will provide example source code that demonstrates how it should be used. All examples can be found in the File menu. You can often realize quickly and vertically prototypes by combining some examples.

5.5. Arduino Basic functions

Every Arduino program contains two basic functions:

void setup(){
}

void loop(){
}

The setup() function is called once in the beginning of the program start-up. Here you can call initialization and setup functions, which are needed in your program.

The loop() function will be called over and over again as fast as possible. In this part you will implement every functionality which will be done during the runtime of the board.