Arduino software environment. Arduino connection and setup. Libraries for the software environment

To write (edit) and upload (firmware) programs (sketches) to Arduino, you need to install a programming program like Arduino IDE, or use an on-line Web editor. Download (upload) Arduino IDE program latest version, or you can use the web editor from the Software section of the arduino.cc website.

Downloading (uploading) Arduino IDE from the official website:

Go to the official Arduino website and select, from the list provided, the operating system your computer is running on. In this article we will look at installing the Arduino IDE on the Windows operating system. Selecting the first line " Windows Installer"You will install the Arduino IDE (as you install any other programs), and by selecting the second line " Windows ZIP file for non admin install» You will download a ZIP archive with a program folder that you can run without installation (even if you do not have administrator rights on your computer).

Regardless of which operating system you choose, you will be asked to thank the developers, it’s exactly that, it’s up to you.


If you just want to download the program, then click on the “JUST DOWNLOAD” button; if you want to download the program and thank the developers, contributing to the further development of the software, then click on the “CONTRIBUTE & DOWNLOAD” button.

Wait until the file is downloaded

After the download is complete, the file should be in the folder: " This computer > Downloads "(unless you specified a different location to save the file).

Run installation file

from the folder: “This computer > Downloads” (you will have Arduino IDE version numbers instead of X.X.X in the file name).






  • 1 message: introduces you to license agreement, click on the “I Agree” button, message 2 will appear.
  • Message 2: prompts you to select installation components, click on the “Next” button, message 3 will appear.
  • Message 3: prompts you to select the path to install the Arduino IDE, click on the “Install” button, message 4 will appear.
  • 4 message: informs you about the progress of the Arduino IDE installation, after which message 5 will appear.
  • Message 5: informs you that the Arduino IDE installation is complete, click on the “Close” button.

During the installation process, 4 messages may appear above the window Windows windows asking for your permission to install drivers:


Allow the installation of drivers by clicking on the “Install” button; these drivers will allow you to identify and work with Arduino boards connected via the USB bus.

This completes the Arduino IDE installation. .

The program icon should appear on your desktop:

Launching Arduino IDE:

When you launch the program for the first time, a message may appear Windows Firewall about blocking access for some Arduino IDE Java networking functions:


Allow access by clicking on the “Allow access” button. After which, this window will not appear.

The Arduino IDE program window will open:


The following figure shows the purpose of the areas and functional buttons of the program:


Now you can write a sketch (code) and upload (upload/flash) it to Arduino. But before that, you need to connect the Arduino board to the computer and tell the Arduino IDE program which Arduino board you connected and to which port...

Connecting the Arduino board:

After you connect the Arduino board via USB port to the computer, the Arduino IDE program needs to indicate which Arduino board you connected. To do this, select the desired board from the list in the menu section " Tools > Pay > Name of your board


Now you need to select the Com port to which your Arduino board is connected. To do this, select the desired Com port from the list of available Com ports in the menu section " Tools > Port > Available port number", as shown in the following figure:


If the USB controller of your Arduino board is implemented on an FTDI or similar chip, then in the list of available Com ports you will not see the name of the Arduino board in brackets opposite the Com port. In our case, you would simply see “COM1” and “COM7”, then the question arises, which of these ports is the Arduino board connected to?

This issue can be resolved very simply. Disconnect the Arduino board from the computer and open the " Tools > Port » . In the list of Com ports you will only see available Com ports, that is, in our case only “COM1”. Now connect the Arduino board to the computer and open the menu again " Tools > Port » . Now you will see that the list of Com ports has increased by one (in our case, “COM7” has been added to “COM1”), and it is to the Com port that appears that your Arduino board is connected.

If, when you connect the Arduino board, you do not see the appearance of a new Com port, then the USB controller of your Arduino board is implemented on third-party chips and you need to install an additional driver for it. Like, for example, the driver for the CH340G chip.

Uploading a sketch from the Arduino IDE program to the Arduino board:

After you have indicated the type of Arduino board, selected the Com port and written your sketch (program code), the sketch can be uploaded (uploaded/flashed) to the Arduino board controller . To do this, select the menu item “» or click on the button in the form of a circle with an arrow:


If you wrote a sketch in a new window and did not save it to a file, then before loading it into the Arduino board, Arduino programs The IDE will prompt you to save it. Enter the name under which you want to save the sketch to a file and click on the “Save” button.


During loading, you will see a status bar that will display the progress of compilation and loading of the sketch. If there are no errors in the sketch and it is successfully loaded, then information about the amount of used and available Arduino memory will appear in the notification area, and the message “Download complete.” will appear above the notification area.


The small sketch above (in the picture) will make the LED on the Arduino board blink. Many sketches are simplified and shortened by using libraries. You can find out what libraries are and how to install them in the section.

Let's look at getting started with Arduino on the Windows operating system. Let's take the platform as an example Arduino Uno. For other boards the difference is minimal.

Installing Arduino IDE

First you need to install the Arduino integrated development environment - Arduino IDE - on your computer. Due to the war between Arduino SRL and Arduino LLC, depending on the platform model, choose the Arduino IDE version.

Download Arduino IDE 1.6.4 - d For all platforms except Arduino Leonardo ETH and Arduino M0 (stable version from Arduino LLC).

Launching Arduino IDE

After you have downloadedor and installed the Arduino IDE, let's launch it! A window should open as in the figure below.

Something went wrong?

    Arduino IDE won't start? The JRE (Java Runtime Environment) is probably installed incorrectly on your computer. Refer to point (1) to reinstall the Arduino IDE: the installer will do all the work of deploying the JRE.

Connecting Arduino to Computer

After installing the Arduino IDE, it's time to connect the Arduino platform to your computer.

Connect the Arduino to your computer via a USB cable. You will see the “ON” LED on the board light up and the “L” LED will start blinking. This means that power is supplied to the board, and the Arduino microcontroller has begun to execute the factory-programmed “Blink” (blinking LED).

To configure the Arduino IDE to work with a specific Arduino, we need to find out what COM port number the computer assigned to this platform. To do this, go to Windows Device Manager and open the “Ports (COM and LPT)” tab. We should see the following picture:


This means that the operating system recognized our Arduino board as a COM port, selected the correct driver for it and assigned this COM port number 2. If we connect another Arduino board to the computer, the operating system will assign it a different number. Therefore, if you have several Arduino boards, it is very important not to get confused about the COM port numbers.

Something went wrong?

If, after connecting the Arduino to the computer, no new devices appear in the device manager, this may be due to one of the reasons:

    Faulty USB cable or port

    Blocking by the operating system

    Faulty board Arduino

Setting up the Arduino IDE to work with Arduino

Now we need to tell the Arduino IDE that the board it is going to communicate with is on COM port number 2.

To do this, go to the menu: Tools Port and select the “COM2” port. Now the Arduino IDE knows that something is on the “COM2” port. And she will soon have to communicate with this “something”.

So that the Arduino IDE does not have any doubts, we need to tell the Arduino IDE which board we will work with. To do this, go to the menu: Tools Pay and select the “Arduino Uno” board.

Now the Arduino IDE knows everything it needs to flash the Arduino firmware.

Something went wrong?

    Is the list of serial ports empty? This means the Arduino is not connected correctly. Return to step (3) to debug the connection.

    Arduino IDE incredibly slow when navigating menus? Disable everything in Device Manager external devices type "Bluetooth Serial". For example, a virtual device to connect to mobile phone over Bluetooth may cause this behavior.

The environment is configured, the board is connected. Now you can proceed to uploading the sketch.

Arduino IDE contains a lot ready-made examples, in which you can quickly see the solution to a problem. It also contains a simple example of “Blink”. Let's select it.

Let's modify the code a little to see the difference with the factory LED blinking.

Instead of the line:

let's write:

Full version of the code:

void setup() ( // set pin 13 to output mode pinMode(13, OUTPUT); ) void loop() ( // send a “high signal” to pin 13 digitalWrite(13, HIGH); // wait 100 milliseconds delay( 100); // send a “low signal” to pin 13 digitalWrite(13, LOW); // wait 100 milliseconds delay(100); )

The "L" LED should now light up and go out every 100 milliseconds. That is 10 times faster than the factory version. Let's upload our sketch to Arduino and check if this is true?

After booting, the LED will start flashing faster. This means that everything worked out. Now you can safely move on to “”

Something went wrong?

    As a result of the download, an error like avrdude appears: stk500_get sync(): not in sync: resp = 0x00 ? This means that the Arduino is not configured correctly. Return to the previous steps to ensure that the device has been recognized by the operating system and the Arduino IDE is installed correct settings for COM port and board model.

28 09.2016

Have you ever thought about making your life easier at home? To have things that would solve everyday, routine tasks for you. A smart device that would carry out useful function, for example, watered the garden, cleaned the room, carried the load. These problems can be solved. But just buying it won't be enough. Any industrial logic controller or the chip needs a “brain” to do a certain sequence actions. To perform operations in our case, the Arduino programming language is suitable.

From this article you will learn:

Greetings, friends! For those who don’t know me, my name is Gridin Semyon. You can read about me. Today’s article will be devoted to two main programs, without which we will not have further movement and mutual understanding.

General description of programming languages

As I wrote above, we will consider two popular development environments. By analogy with, can be divided into graphics editor and “smart notepad”. These are Arduino IDE and FLprog programs.

The basis of the development environment is Processing/Wiring - this is regular C++, supplemented with functions and various libraries. There are several versions for operating systems windows, Mac OS and Linux.

What is their fundamental difference?? The Arduino IDE is a development environment that describes program code. And FLprog is similar to CFC CoDeSyS, which allows you to draw diagrams. Which environment is better? Both are good and convenient in their own way, but if you want to get serious about controllers, it's best to learn languages ​​similar to SI. Their main advantage is the flexibility and unlimited nature of the algorithm. I really like the Arduino IDE.

Description of Arduino IDE

The distribution can be downloaded from official website. Download the archive, it takes up a little more than 100 MB. The installation is standard, like all applications for Windows. Drivers for all types of boards must be installed in the package. And this is what the program's working window looks like.

The Arduino development environment consists of:

  • program code editor;
  • message areas;
  • text output windows;
  • toolbars with buttons for frequently used commands;
  • several menus

Arduino IDE Settings

A program written in the Arduino development environment is calledsketch. The sketch is written in a text editor, which has color highlighting of the created program code. Example simple program in the picture below.

Additional functionality can be added usinglibraries,representing code designed in a special way. Basically, it is not accessible to the developer. The environment usually comes with a standard set, which can be gradually replenished. They are in the subdirectorylibraries Arduino directory.

Many libraries come with examples located in the folderexample.Selecting a library in the menu will add the following line to the source code:

Arduino

#include

#include

This is a directive - a kind of instruction, a header file describing objects, functions, and library constants. Many functions have already been developed for most common tasks. Believe me, this makes the programmer's life easier.

After we have connected the electronic board to the computer. We make the following settings - select the Arduino board and the Com port through which we will connect.

Arduino

void setup() ( // initialize digital pin 13 as an output. pinMode(13, OUTPUT); ) void loop() ( digitalWrite(13, HIGH); delay(1000); digitalWrite(13, LOW); delay(1000 );

void setup() (

// initialize digital pin 13 as an output.

pinMode(13, OUTPUT);

void loop() (

digitalWrite(13, HIGH);

delay(1000);

digitalWrite(13, LOW);

delay(1000);

So, by the way, it is convenient to check the functionality of the board that came from the store. Fast and easy.

There is one more convenient thing. It's calledMonitor serial port (Serial Monitor). Displays data sent to the platformArduino.I usually look at what signals they give me various sensors, connected to the board.

Connecting libraries

Exist different ways for adding custom functions. You can connect libraries in three ways:

  1. Using Library Manager
  2. Using import as a .zip file
  3. Manual installation.

1. Using Library Manager.In the working window of the program, select the Sketch tab. After that, click on the Connect library button. The library manager will open in front of us. The window will already display installed files with signatureinstalledand those that can be installed.

2.Using import as a .zip file.Often on the Internet you can find library files packed into archives with a zip extension. It contains a header file.h and a code file.cpp. There is no need to unpack the archive during installation. Just go to the Sketch menu - Connect library - Add .ZIP library

3.Manual installation.First, close the Arduino IDE program. We first unpack our archive. And we transfer the files with the extension .h and .cpp to a folder with the same name as the archive. Place the folder in the root directory.

My Documents\Arduino\libraries

Description of FLPprog

FLprog is a free project from independent developers that allows you to work with function blocks or ladder diagrams. This environment is convenient for people - not programmers. It allows you to visually and clearly see the algorithm using diagrams and functional blocks. You can download the distribution at official website.

I have been following the project for quite a long time. The guys are developing, constantly adding new functionality and changing old ones. I see promise in this environment. Since it performs two important functions:simplicity and ease of use.

Let's try to create a simple project. We will switch output 13 to LED.

We create new project. In the top window, add the required number of inputs and outputs, set a name and assign a physical input or output to the board.

We pull out the elements we need from the object tree and the elements we need onto the editing canvas. In our case, we can use a simple RS trigger to turn it on and off.

After creating the algorithm, click on the compile button, the program provides a ready-made sketch in the IDE.

We have looked at the capabilities and convenience of programs for developing algorithms on the Arduino series controller. There are also programs that allow you to create structural diagrams and visual pictures. But I recommend using a text editor because it will be easier for you later. Tell me, which environment is most convenient for you and why??

On September 22, I participated in a seminar in Krasnodar “Touch panel controllers OVEN SPK.” The conference was held in the fashionable and beautiful Bristol Hotel. It was very interesting and cool.

In the first part of the seminar, we were told about the capabilities and advantages of OWEN products. Afterwards there was a coffee break with donuts. I picked up a bunch of things, donuts, cookies, and candies, because I was very hungry. =)

In the second part of the seminar, after lunch, we were presented. They told us a lot about Web visualization. This trend is starting to gain momentum. Well, of course, control the equipment via any Internet browser. This is really cool. By the way, the equipment itself is in the suitcase.

I will publish a series of articles on CoDeSyS 3.5 in the near future. So, if anyone is interested, subscribe or just come visit. I will always be glad!!!

By the way, I almost forgot, the next article will be about the Arduino electronic board. It will be interesting, don't miss it.

See you in the next articles.

Best regards, Gridin Semyon.

× Close


Arduino IDE is a free development environment for the Arduino platform, containing a code editor, compiler and firmware transfer module to the board. This environment is perfect for programmers who prefer C and C++ programming languages. Programs (sketches) written using the Arduino IDE are processed by a preprocessor and then compiled into AVR-GCC.

The Arduino development environment comes with a library of programs called "Wiring", derived from the Wiring project, which makes many common I/O operations much easier.

In general, Arduino allows you to create electronic devices, having the ability to receive signals from various digital and analog sensors connected to them, as well as control various actuators. Arduino-based projects can run independently or interface with software on a PC.

Key Benefits of Arduino IDE for Windows

Among programs with similar functions, Arduino IDE is accessible, understandable for beginners and has a wide range of capabilities for professionals. The program has an easy to use and understand interface. It is compatible with different versions operating rooms Windows systems. Therefore, using standard libraries, every beginner can create a simple project in a matter of minutes.

It is also important that this development environment provides all the basic tools necessary for work. Among its functions are, for example, saving, exporting, searching, checking, replacing sketches.

Main disadvantages

Users note that some versions of the Arduino IDE are unstable. Also, don’t expect that you can create a serious project with this program. Arduino IDE is more suitable for hobby projects.

Installation

  • download the software from the link;
  • open the downloaded file;
  • run the commands, look in the installation window.

What's new

  • New goal! ARM64 boards are now fully supported (Nvidia Jetson and RaspberryPi3 with 64-bit operating system).
  • Fixed bugs related to UTF8 on Windows.
  • Fixed: Can now compile again using OpenJDK (JavaFx dependency removed).
  • Fixed: Only use TouchBar on OSX 10.12 or higher.
  • PluggableDiscovery: Easily add your own discoverer and make it available in the Boards/Port menu (thanks to @PaulStoffregen for the idea and initial implementation).
  • LibManager: slowdown during search has been reduced.
  • Fixed: Make sure the sketch line is visible if it contains an error and needs to be highlighted.
  • Linux: Installer now tries to symlink /usr/local/bin (this does not affect normal off-system installation) Thanks @2E0PGS.
  • Fixed firmware update not available for third party WINC boards.
  • Use lexicographic distance as a last chance to find the library you need (if any other technique fails).
  • Fixed some prototypes being inserted in the middle of a function.

The Arduino development environment consists of a built-in text editor program code, message area, text output window (console), toolbar with buttons for frequently used commands and several menus. The development environment is connected to the Arduino hardware to download programs and communicate.

Download
Serial Bus Monitoring

Displays data sent to the Arduino platform ( USB board or serial bus card). To send data, you must enter text and press the Send or Enter button. Then select the baud rate from the drop-down list corresponding to the value Serial.begin in the sketch. On Mac or Linux OS, the Arduino platform will be rebooted (the sketch will start over) when serial bus monitoring is connected.

It is possible to exchange information with the platform through Processing, Flash, MaxMSP, etc. programs. (see interface descriptions page for details).

Settings

Some settings can be changed in the window Preferences(Arduino menu on Mac OS or File on Windows and Linux OS). The rest of the settings are in the file, the location of which is indicated in the Preferences window.

Platforms

The choice of platform affects: the parameters (eg CPU speed and baud rate) used when compiling and loading sketches and the bootloader recording settings of the microcontroller. Some platform characteristics differ only in the last parameter (Bootloader), so even if booting successfully with the appropriate selection, you may need to check the difference before writing the Bootloader.

  • Arduino BT
    Clock frequency ATmega168 16 MHz. The Bootloader is loaded together with codes for initializing the Bluetooth module.
  • LilyPad Arduino with ATmega328
    ATmega328 clock frequency 8 MHz (3.3 V) with automatic reboot capability. Complies with Arduino Pro or Pro Mini(3.3 V, 8 MHz) with ATmega328.
  • LilyPad Arduino with ATmega168
    The clock frequency of ATmega168 is 8 MHz.

    The loaded Bootloader has a long timeout (when rebooting, the pin 13 LED blinks three times), because original versions LilyPads do not support automatic reboot. Also external clocks are not supported and therefore Bootloader configures the ATmega168 to load the internal 8 MHz clock.

    If you have later versions of LilyPad (with 6-pin software input), you will need to select Arduino Pro or Pro Mini (8 MHz) with ATmega168 before loading the Bootloader.

  • Arduino Pro or Pro Mini (3.3V, 8MHz) with ATmega328
    ATmega328 clock frequency 8 MHz (3.3 V) with automatic reboot capability. Compatible with LilyPad Arduino with ATmega328.
  • Arduino Pro or Pro Mini (3.3V, 8MHz) with ATmega168
    Clock frequency ATmega168 8 MHz (3.3 V) with automatic reboot capability.
  • Arduino NG or previous versions with ATmega168
    ATmega168 clock speed is 16 MHz without automatic reboot. Compilation and loading corresponds to Arduino Diecimila or Duemilanove with ATmega168, but Bootloader has a long timeout (pin 13 LED flashes three times when rebooting).
  • Arduino NG or previous versions with ATmega8
    ATmega8 clock speed is 16 MHz without automatic reboot capability.