Arduino connection and setup. Arduino IDE software environment for Arduino development

When installing the Arduio IDE, the drivers necessary to work with original Arduino boards should be automatically installed. But the trick is that Chinese boards costs a cheaper controller USB interface, to work with it you need special driver. The Chinese controller is no worse, it's just cheaper =)

If for some reason you have not installed the Arduino drivers, you can install them manually from the program folder.
The CH341 driver for Windows can be downloaded, or you can search it on Google yourself.


Next, connect the Arduino to the computer, wait until Windows recognizes and remembers it (first connection).
P.S. A window will appear informing you that the device has been recognized and connected to COM port With specific number different from number 1

By default, in Linux you can flash Chinese Arduinos without additional equipment. But at first nothing works and the Arduino IDE throws an error.
Here's the thing. Linux (in my case linux mint) defines the Arduino as a ttyUSB* device. Usually this is ttyUSB0. This can be found out with the command dmesg in the terminal.
That is, an interface appears in the system /dev/ttyUSB0. But to work with it, you need access rights. Read and write to device /dev/ttyUSB0 It has root user and users of the dialout group. It is better to avoid working with superuser rights, so you should add your user to the dialout group. This can be done with the following command (note the whoami command is in back quotes)
sudo usermod -a -G dialout `whoami`
After this you need to re-login. Next, launch the Arduino IDE and in the “Tools-Port” menu check the box next to /dev/ttyUSB0.

Thanks for the info Vlad Shemenkov

28 09.2016

Have you ever thought about making your life easier at home? To have things that would solve everyday things for you, routine tasks. Smart device, which 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 Windows, Mac OS and Linux operating systems.

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 it looks like working window programs.

The Arduino development environment consists of:

  • editor program code;
  • 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. An example of a 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 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 from the menu will add it to source lines:

Arduino

#include

#include

This is a directive - some kind of instruction, header file with a description of 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 carry out 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's another one 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 in archives with 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 free project independent developers, allowing you to work with functional blocks, or with 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 change the old one. 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 required quantity inputs and outputs, set a name and assign physical entrance or board output.

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 a fashionable and beautiful hotel"Bristol". 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 electronic board Arduino. It will be interesting, don't miss it.

See you in the next articles.

Best regards, Gridin Semyon.

Using the Arduino IDE, you can, based only on knowledge of C++, solve a variety of creative problems related to programming and modeling.

Arduino IDE is a software development environment designed for programming the board of the same name. To date, since using Arduino construct all kinds of interactive, educational, experimental, entertainment models and devices. The interface is relatively easy to learn; it is based on the C++ language, so even novice programmers can master the tools.

Where can I download Arduino IDE

The program itself is open source. All basic tools are distributed free of charge - just select the version that matches your operating system.

With descriptions (on English language) can be found on the official website page https://www.arduino.cc/en/main/software. You can also download there the required version programs.

After selecting the desired operating system and the desired file Installation will take you to the download page (see below), where you simply need to click "Just Download" to start downloading.

The current version of Arduino Ide at the time of publication of this article is 1.8.5.

Arduino IDE in Russian

Initially, the toolkit is supplied in English. And although the menu commands are quite simple, the program can be easily translated into the desired language.

A complete list of released localizations is presented on this page: http://playground.arduino.cc/Main/LanguagesIDE. Russian language is included in the list.

Russian is included in the list of Arduino IDE languages.

To turn on Russian-language interface, you need to use the command:

FilePreferencesLanguage
(File → Settings → Language)

and select Russian from the list.

Setting up the environment

Installing the Arduino software environment is a fairly simple process. After you have selected and downloaded the desired version, you need to start the installation through the file arduino.exe.

As always, you must first agree to the License Agreement, despite the fact that the environment itself is distributed free of charge.

The next step is to select the actions that the installer must take. You can tick all the boxes.

If the installer prompts you to install USB-to-serial driver - click Install.

IDE setup

A USB port is used to connect the board to a computer. Programming does not require special equipment; the board itself is compact and lightweight.

Step 1

We connect the Arduino board to the computer.

Step 2

Let's go to:
Start → Control Panel → Device Manager
We find " COM ports and LPT" and see our board on COM2.

It's likely that you won't see anything. In most cases, the problem is that you bought a board based on the CH340G chip. In this case, you need to use .

Step 3

Launch the Arduino IDE and go to: Tools → Port. Select port COM2 (or the one you got in the step above).

Step 4

Choose a board.

This completes the setup. Now you have the Arduino IDE set up and you can start developing your projects.

Libraries for the software environment

There are 3 ways to connect the library to the Arduino IDE:

  1. Use the library manager, which appeared in the program since version 1.6.2. You must use the command "Sketch" → Include Library → Manage Libraries. A list of available libraries will appear that can be enabled or disabled (see screenshot below).
  2. Add the downloaded library in *.ZIP format. To do this you need to use the command "Sketch" → Include Library → Add .ZIP library. After that, select the file so that the library is added to the list, and restart the program.
  3. Add the library file manually. To do this, you will need to unpack the archive and make sure that all the files are in one folder. After this, it will need to be placed in the directory with user libraries, which is located at " My Documents\Arduino\libraries" (Windows) or " ~/Documents/Arduino/libraries"(Linux). This method is quite complicated; it is recommended primarily for experienced programmers.

To date, versions are available for operating systems Windows, Linux, MacOS. At the beginning of September 2017, the most a new version Arduino IDE - 1.8.5. You can download it above - select the desired option from the table, or on the page https://www.arduino.cc/en/main/software. For Linux there are 32-bit, 64-bit and ARM versions. For Windows, in addition to the installable and portable version, there is a version in the form of a Windows application.

Thus, working with the Arduino IDE does not create any difficulties even for programmers who have not yet fully mastered the C++ language. By experimenting with functions, adding your own libraries or downloading new ones, you can achieve excellent results and solve even very non-standard creative problems.

All this explains its growing popularity and the increase in the number of programmers who are experimenting with the software environment and adding new functions to it.

Arduino IDE is an environment for developing programs (sketches) for microcontrollers of the Arduino line. By using this application schoolchildren and students get acquainted with programming and radio design, and amateur designers around the world create educational and entertaining projects on Arduino. The application is available for free download on the manufacturer's official website.

Where to download Arduino IDE in Russian

The program is free and open source, Arduino language Based on the C++ programming language, but greatly simplified with the help of various libraries. You can download Arduino IDE on the official website at: www.arduino.cc/en/Main/Software, where you can select suitable version for your operating system, you can also download the archive with the program from Google Disk.

Installing Arduino IDE Windows/Linux

After downloading the installation file .exe the program will create it itself required folders for storing sketches and libraries in the user folder My Documents. Initially, Arduino IDE 1.8.6 contains only standard libraries. To work with separate modules you will additionally need to download and install necessary files libraries for connecting modules to the Arduino board.

Video. Installing Arduino IDE on Windows 7/Win 10

Video. Installing Arduino IDE in Ubuntu/Debian/Mint

Setting up the Arduino IDE for work

For fine tuning Arduino IDE 1.8.5 on Windows or Linux follows through the toolbar " File -> Settings» Several items will be available in the new window that you can customize (see picture below). After setting up the application, for the changes to take effect, click the " OK" and restart the program. The settings can be changed at your discretion.

  1. choosing a place to store sketches and libraries;
  2. selecting the interface language in the Arduino IDE 1.8 program
  3. selecting font size text editor and scale;
  4. show detailed messages when compiling/loading;
  5. show line numbers in a text editor;
  6. checking for updates on the network when starting the Arduino IDE;
  7. saving sketches before compiling/uploading.

Setting up Arduino IDE for Nano/Mega 2560/Uno

When connecting the microcontroller for the first time, you should make sure that the Arduino IDE 1.8 program has detected the Arduino Nano board connected to USB port. When you connect any Arduino board to your computer, a virtual COM port is created. You can check the connection through the device manager or through the Arduino IDE panel " Tools -> Port"- in addition to COM1, an additional port should appear.


When connected Arduino microcontroller to different USB ports computer, number COM port will change. If you have an “unofficial” microcontroller with microUSB, then you need to additionally install drivers for the CH340G. If the port is determined, then before uploading the sketch you should select the board that you are using in the panel Arduino tools IDE « Tools -> Board Manager»


When connected to a computer Arduino Uno should be selected in the Arduino/Genuino Uno Board Manager. In the case of a board Arduino Mega or Nano, you must additionally select a microcontroller processor. For Nano it can be ATmega168 or ATmega328, for Mega board it can be ATmega2560 or ATmega1280 processor. You can find out the type by the characteristics that the manufacturer usually indicates on the printed circuit board.

Video. Arduino IDE connection Nano/Uno/Mega

After completing all operations, you should check the connection of the microcontroller and upload an empty sketch to the board or a sketch for blinking the LED on the Arduino. To do this, there are corresponding icons on the toolbar: see the picture with the Arduino IDE functions above. At incorrect connection or there are no drivers, the program will report an error - programmer is not responding.

Arduino IDE Web Editor online

Instructions for using this service are only in English and are available here. One of the minuses should also be noted that a sketch written in the Arduino Web Editor can only be loaded into the original Arduino board. Access to the service is available only to registered users (registration is free). You can leave questions in the comments

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, operating system on which your computer is running. In this article we will look at installing the Arduino IDE on the operating system. Windows 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 by contributing further development 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 PC > Downloads” (you will have numbers instead of X.X.X in the file name Arduino versions IDE).






  • 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 network functions Java Arduino IDE:


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 function buttons programs:


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 your computer, the Arduino IDE program needs to indicate which Arduino board you connected. To do this, select the required fee 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 USB controller If your Arduino board is implemented on an FTDI chip or similar, 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?

Decided this question very simple. Disconnect the Arduino board from the computer and open the menu " 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 connecting 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 chips third party manufacturers and it requires installing additional driver. 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 compiling and loading the sketch. If there are no errors in the sketch and it is successfully loaded, then information about the amount of used and available memory Arduino, 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.