• Arduino IDE software environment for Arduino development. Programming Arduino using ArduBlock using the example of a robot moving along a strip

    Arduino is a controller program for programming various automatic devices.

    Application

    The Arduino software consists of several parts - the development environment and the board. First you will need to download the program. There should be no problems with downloading and using it, since the software is distributed completely free of charge and has a Russian-language localization. After this, you should buy a special board. Keep in mind that without purchasing it, there is no point in installing the software.

    The board itself is needed in order to connect various elements to it such as light bulbs, motors, sensors, speakers and other parts. Well, with the help of the controller it will be possible to write a program that will control this entire created device. Among other things, Arduino can connect to software installed on the user’s computer. Among the programs with which it integrates are Pure Data, Macromedia Flash, Super Collider and several others.

    Interface

    The Arduino interface is quite laconic. On top panel You can find the buttons "File", "Edit", "Sketch", "Tools" and "Help". Below them there are also several function keys, whose functionality can be understood by the icons present on them. The development environment includes a slightly primitive code editor, a compiler and a module with which you can download firmware to the board using a USB cable. To use all these modules, you must be proficient in the C++ programming language, since the firmware will be written using the “pluses”.

    Key Features

    • allows you to create robotic devices and fully control them;
    • When installing the software, you should additionally buy a board and USB;
    • Suitable for use by novice programmers;
    • interacts with some of the programs installed on the PC;
    • uses C++ language when programming;
    • supports all current Windows versions;
    • includes a compiler and debugging tools;
    • has a very pragmatic graphical shell.

    To write (edit) and upload (firmware) programs (sketches) to Arduino, you need to install a programming program like Arduino IDE, or use the 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 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 located 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.

    On this Arduino installation IDE completed .

    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 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 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?

    Is being 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 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, the Arduino 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.

    × 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 with using Arduino IDEs are processed by a preprocessor and then compiled into AVR-GCC.

    The Arduino development environment comes with a library of programs called "Wiring", originating from the Wiring project, which allows you to do a lot standard operations I/O is much simpler.

    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, you should not hope that you can create a serious project with this program. Arduino IDE is more suitable for hobby projects.

    Installation

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

    What's new

    • Fixed: IDE doesn't start if library_index.json is corrupted.
    • Fixed: IDE does not start if library with invalid version is found.
    • Fixed: Crash issues in very complex sketches (eg Marlin firmware).
    • Fixed: Improved dialog explaining that MacOSX 10.8 is now required.
    • Fixed: Slow File and Tools menus on MacOSX.
    • Fixed: Weird Board Manager behavior if the AVR kernel is downgraded to a version earlier than 1.6.22.
    • Improved usability on first use if the user does not select a serial port.
    • The custom Tools menu now maintains the order defined in the boards.txt file.
    • AVR: Fixed EEPROM warnings.
    • AVR: Treat "conversion narrowing" as a warning, not an error. This will force some libraries to compile again.
    Arduino (

    IDE (from the English Integrated Development Environment - integrated development environment) is an application or group of applications (environment) designed for creating, configuring, testing and maintaining software.

    The integrated development environment is characterized by the presence of complex functionality, including editing and compiling source code, creation of software resources, creation of databases, etc. You can read more about the IDE and the development of this concept.

    Within Arduino project software was created that meets the basic requirements of a typical IDE. This is not powerful software like Eclipse or NetBeans, but simple, functional program, which allows us to write, compile and download a program to the microcontroller.

    The simple structure of the Arduino IDE is an advantage because it allows you to quickly master the program and move on to developing applications for Arduino. Despite its simplicity and intuitive controls, it is worth paying attention to the most important elements programs.

    After launching the program, you can find four main functional elements:

    1. program menu;
    2. panel quick access to the most important functions;
    3. editor (for placing program code);
    4. message and program status panel.

    The program menu allows you to manage the project, for example, create a new project, save the current one, or print the source code on a printer.

    An interesting feature of the program is the built-in set of example programs. This is very convenient, since sample programs can be immediately checked by loading them into the microcontroller. If necessary, you can save the example and change it to suit your needs.

    The File and Edit menus contain standard options.

    The Sketch menu contains options for compiling the project and importing the necessary libraries.

    Interesting and useful element The IDE is the "Tools" menu, which includes functions for automatically formatting code, archiving the project, turning on the serial port monitor (USB in Arduino is treated as a regular serial port).

    The most important element of the Tools menu is the ability to select the appropriate board, that is, your Arduino system connected to the computer. Everyone is on the list official versions Arduino. If your board type is not in the list, then you can add it by changing one of the program files. However, this is material for a separate article.

    In the Tools menu you can also set the port to which the Arduino board is connected. The Arduino IDE detects the port itself, but sometimes you need to manually set the port number in the settings.

    Using the Arduino IDE you can also boot, that is, program a Bootloader (bootloader) for a new, clean Atmega microcontroller, which allows you to clone chips or simply replace a faulty microcontroller in Arduino.

    For regular work with Arduino IDE, a quick access panel is used, which is equipped with the most important buttons. This solution, which makes working with the IDE package easier, gives us direct access to almost all the necessary parameters when writing and testing a program.

    They allow (from left to right):

    1. compile the program;
    2. load the program into the microcontroller (before flashing the firmware, the program code is compiled);
    3. start working on a new project;
    4. open an existing project;
    5. save the project to disk;
    6. Enable the serial port monitor.

    All options located on the quick access panel are duplicated in the program menu.

    An additional useful element located under the serial port monitor power button is a menu for managing tabs (7). Tabs in the Arduino IDE make it easier to write complex projects, and also allow you to work with several projects at the same time.

    The largest part of the program window is intended for writing the program code itself. The editor in the Arduino IDE is not very advanced, but has the most important elements to make writing easier simple programs. Such elements include syntax highlighting and blocks (brackets). It's not a lot, but it's enough for simple projects.

    The last element of the program is the message and status window. The information displayed there allows the user to find errors in program code and receive confirmation that compilation and loading of the program into the microcontroller is complete.

    To summarize, the Arduino IDE is a simple software package that allows you to program any known Arduino board, communicate with serial port and easily manage projects.

    Hello! I am Alikin Alexander Sergeevich, teacher additional education, I lead the “Robotics” and “Radio Engineering” clubs at the Center for Youth and Youth Technology in Labinsk. I would like to talk a little about a simplified method of programming Arduino using the ArduBlock program.

    I entered this program into educational process and is delighted with the result; it is in particular demand among children, especially when writing simple programs or for creating some kind of initial stage complex programs. ArduBlock is a graphical programming environment, i.e. all actions are performed with drawn pictures with signed actions in Russian, which greatly simplifies the learning of the Arduino platform. Children from the 2nd grade can easily master working with Arduino thanks to this program.

    Yes, someone might say that Scratch still exists and it is also a very simple graphical environment for Arduino programming. But Scratch does not flash the Arduino, but only controls it using USB cable. Arduino is computer dependent and cannot work autonomously. When creating your own projects, autonomy is the main thing for Arduino, especially when creating robotic devices.

    Even everyone knows LEGO robots, such as NXT or EV3, are no longer so interesting to our students with the advent of the ArduBlock program in Arduino programming. Arduino is also much cheaper than any LEGO construction kits, and many components can simply be taken from old household electronics. The ArduBlock program will help not only beginners, but also active users of the Arduino platform.

    So, what is ArduBlock? As I already said, this is a graphical programming environment. Almost completely translated into Russian. But the highlight of ArduBlock is not only this, but also the fact that the ArduBlock program we wrote converts into Arduino IDE code. This program is built into the Arduino IDE programming environment, i.e. it is a plugin.

    Below is an example of a blinking LED and a converted program in Arduino IDE. All work with the program is very simple and any student can understand it.

    As a result of working with the program, you can not only program Arduino, but also study commands that we do not understand in text format Arduino IDE, but if you’re too lazy to write standard commands, you can quickly use the mouse to sketch out a simple program in ArduBlok, and debug it in Arduino IDE.

    To install ArduBlok, you must first download and install the Arduino IDE from the official Arduino website and understand the settings when working with Arduino board UNO. How to do this is described on the same website or on Amperka, or watch it on YouTube. Well, when all this is figured out, you need to download ArduBlok from the official website, here. I don’t recommend downloading the latest versions, they are very complicated for beginners, but the version from 2013-07-12 is the best, this file is the most popular there.

    Then, rename the downloaded file to ardublock-all and in the “documents” folder. We create the following folders: Arduino > tools > ArduBlockTool > tool and in the latter we throw the downloaded and renamed file. ArduBlok works on everyone operating systems, even on Linux, I checked it myself on XP, Win7, Win8, all examples for Win7. The installation of the program is the same for all systems.

    Well, to put it simply, I prepared an archive on the 7z Mail disk, unpacking which you will find 2 folders. Already in one work program Arduino IDE, and in another folder the contents must be sent to the documents folder.

    In order to work in ArduBlok, you need to run the Arduino IDE. Then we go to the Tools tab and there we find the ArduBlok item, click on it - and here it is, our goal.

    Now let's look at the program interface. As you already understand, there are no settings in it, but there are plenty of icons for programming and each of them carries a command in Arduino IDE text format. New versions have even more icons, so understanding the latest version of ArduBlok is difficult and some of the icons are not translated into Russian.

    In the "Management" section we will find a variety of cycles.

    In the “Ports” section, we can manage the values ​​of the ports, as well as the sound emitter, servo or ultrasonic proximity sensor connected to them.

    In the “Numbers/Constants” section, we can select digital values ​​or create a variable, but you are unlikely to use what is below.

    In the “Operators” section we will find all the necessary comparison and calculation operators.

    The Utilities section mainly uses timed icons.

    "TinkerKit Bloks" is the section for purchased TinkerKit sensors. We, of course, don’t have such a set, but this does not mean that the icons are not suitable for other sets, on the contrary, it is very convenient for the guys to use icons such as turning on an LED or a button. These signs are used in almost all programs. But they have a peculiarity - when you select them, there are incorrect icons indicating ports, so you need to remove them and substitute the icon from the “numbers/constants” section at the top in the list.

    “DF Robot” - this section is used if the sensors specified in it are available, they are sometimes found. And our example today is no exception, we have an “Adjustable IR Switch” and a “Line Sensor”. The “line sensor” is different from the one in the picture, since it is from the Amperka company. Their actions are identical, but the Ampere sensor is much better, since it has a sensitivity regulator.

    “Seedstudio Grove” - I have never used the sensors in this section, although there are only joysticks. In new versions this section has been expanded.

    AND last section This is the Linker Kit. I did not come across the sensors presented in it.

    I would like to show an example of a program on a robot moving along a strip. The robot is very simple, both to assemble and to purchase, but first things first. Let's start with its acquisition and assembly.

    Here is the set of parts itself, everything was purchased on the Amperka website.

    1. AMP-B001 Motor Shield (2 channels, 2 A) RUB 1,890
    2. AMP-B017 Troyka Shield RUB 1,690
    3. AMP-X053 Battery compartment 3×2 AA 1 60 RUR
    4. AMP-B018 Digital line sensor RUB 2,580
    5. ROB0049 MiniQ two-wheeled platform RUB 1,1890
    6. SEN0019 Infrared obstacle sensor RUB 1,390
    7. FIT0032 Mount for infrared obstacle sensor RUB 1,90
    8. A000066 Arduino Uno 1 1150 RUR

    First, let's assemble the wheeled platform and solder the wires to the motors.

    Then we will install racks to mount the board Arduino UNO which were taken from the old motherboard or other similar fastenings.

    Then we attach the Arduino UNO board to these racks, but we can’t fasten one bolt - the connectors are in the way. You can, of course, unsolder them, but this is at your discretion.

    Next we attach the infrared obstacle sensor to its special mount. Please note that the sensitivity regulator is located on top, this is for ease of adjustment.

    Now we install digital line sensors, here you will have to look for a couple of bolts and 4 nuts for them. We install two nuts between the platform itself and the line sensor, and fix the sensors with the rest.

    Next we install Motor Shield, or otherwise you can call it the motor driver. In our case, pay attention to the jumper. We will not be using a separate power supply for the motors, so it is installed in this position. The lower part is sealed with electrical tape to prevent accidental short circuits from the Arduino UNO USB connector, just in case.

    We install Troyka Shield on top of the Motor Shield. It is necessary for the convenience of connecting sensors. All the sensors we use are digital, so the line sensors are connected to ports 8 and 9, as they are also called pins, and the infrared obstacle sensor is connected to port 12. Be sure to note that you cannot use ports 4, 5, 6, 7 as they are used by Motor Shield to control motors. I even specially painted over these ports with a red marker so that the students could figure it out.

    If you have already noticed, I added a black bushing, just in case, so that the battery compartment we installed would not fly out. And finally, we secure the entire structure with a regular elastic band.

    There are 2 types of battery compartment connections. First connection of wires to Troyka Shield. It is also possible to solder the power plug and connect it to the Arduino UNO board itself.

    Our robot is ready. Before you start programming, you will need to learn how everything works, namely:
    - Motors:
    Ports 4 and 5 are used to control one motor, and 6 and 7 the other;
    We regulate the rotation speed of the motors using PWM on ports 5 and 6;
    Forward or backward by sending signals to ports 4 and 7.
    - Sensors:
    We are all digital, so they give logical signals in the form of 1 or 0;
    And in order to adjust them, they have special regulators, and with the help of a suitable screwdriver they can be calibrated.

    Details can be found at Amperke. Why here? Because there is a lot of information on working with Arduino.

    Well, we probably looked at everything superficially, studied it and, of course, assembled the robot. Now it needs to be programmed, here it is - the long-awaited program!

    And the program converted to Arduino IDE:

    Void setup() ( pinMode(8 , INPUT); pinMode(12 , INPUT); pinMode(9 , INPUT); pinMode(4 , OUTPUT); pinMode(7 , OUTPUT); pinMode(5, OUTPUT); pinMode(6 , OUTPUT); ) void loop() ( if (digitalRead(12)) ( if (digitalRead(8)) ( if (digitalRead(9)) ( digitalWrite(4, HIGH); analogWrite(5, 255); analogWrite( 6, 255); digitalWrite(7, HIGH); ) else ( digitalWrite(4, HIGH); analogWrite(5, 255); analogWrite(6, 50); digitalWrite(7, LOW); ) ) else ( if (digitalRead (9)) ( digitalWrite(4, LOW); analogWrite(5, 50); analogWrite(6, 255); digitalWrite(7, HIGH); ) else ( digitalWrite(4, HIGH); analogWrite(5, 255); analogWrite(6, 255); digitalWrite(7, HIGH); ) else ( digitalWrite(4, HIGH); analogWrite(5, 0); analogWrite(6, 0); digitalWrite(7, HIGH); ) )

    In conclusion, I want to say that this program is simply a godsend for education, even for self-study it will help you learn Arduino commands IDE. The main highlight is that there are more than 50 installation icons, it starts to “glitch”. Yes, indeed, this is the highlight, since programming only on ArduBlok all the time will not teach you programming in the Arduino IDE. The so-called “glitch” gives you the opportunity to think and try to remember commands for precise debugging of programs.

    I wish you success.