Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:iot-open:programming_fundamentals_rtu:setting_up_programming_environment [2018/01/10 13:32] Agrisniken:iot-open:programming_fundamentals_rtu:setting_up_programming_environment [2020/07/20 09:00] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +
 ====== Setting up the programming environment ====== ====== Setting up the programming environment ======
  
Line 14: Line 15:
 <table PowerPins> <table PowerPins>
 <caption>The power pins of Arduino UNO.</caption> <caption>The power pins of Arduino UNO.</caption>
-^  Name   Description  ^+^  Pin   Description  ^
 |  VIN  | The input of a power supply when USB port is not used, i.e., an external power supply is used. | |  VIN  | The input of a power supply when USB port is not used, i.e., an external power supply is used. |
 |  5V  | A regulated 5V power supply, which can be provided via both USB and VIN. | |  5V  | A regulated 5V power supply, which can be provided via both USB and VIN. |
 |  3.3V  | A 3.3V supply voltage for external circuits. The maximum current that this output can provide is 50 mA. If it is exceeded, the power supply circuits of the microcontroller may be permanently damaged. | |  3.3V  | A 3.3V supply voltage for external circuits. The maximum current that this output can provide is 50 mA. If it is exceeded, the power supply circuits of the microcontroller may be permanently damaged. |
-|  GND  | Ground or port. |+|  GND  | Ground or port 0. |
 </table>   </table>  
  
Line 30: Line 31:
 <table I/OPins> <table I/OPins>
 <caption>Specific I/O pins of Arduino UNO.</caption> <caption>Specific I/O pins of Arduino UNO.</caption>
-^  Name   Description  ^+^  Pin   Description  ^
 |  O(RX) and 1(TX)  | //Serial I/O// for serial communication. RX is used for receiving data, and TX for sending data to external devices. For data transmitting and receiving, the voltage must not exceed 5 V. | |  O(RX) and 1(TX)  | //Serial I/O// for serial communication. RX is used for receiving data, and TX for sending data to external devices. For data transmitting and receiving, the voltage must not exceed 5 V. |
 |  2 and 3  | //External interrupt// pins that can be used to receive external interrupt in cases when the value is low, value is changed, etc. For this functionality the  function //attachInterrupt()// is used. | |  2 and 3  | //External interrupt// pins that can be used to receive external interrupt in cases when the value is low, value is changed, etc. For this functionality the  function //attachInterrupt()// is used. |
-|  PWM: 3, 5, 6, 9, 10, 11  | //Pulse Width Modulation (PWM)// pins are used to provide 8-bit PWM signal that often can be used for motor management or other specific use cases. For this functionality the //analogWrite()// function is used. |+|  PWM: 3, 5, 6, 9, 10, 11  | //Pulse Width Modulation (PWM)// pins are used to provide 8-bit PWM signal that often can be used for motor control or other specific use cases. For this functionality the //analogWrite()// function is used. |
 |  SPI: 10(SS), 11(MOSI), 12(MISO), 13(SCK)  | Pins that support //Serial Peripheral Interface (SPI)// communications. For this the SPI library is used. | |  SPI: 10(SS), 11(MOSI), 12(MISO), 13(SCK)  | Pins that support //Serial Peripheral Interface (SPI)// communications. For this the SPI library is used. |
 |  LED: 13  | This pin is used to manage the built-in LED. LED can be turned on by setting the value of pin HIGH and turned off by setting pin value LOW. | |  LED: 13  | This pin is used to manage the built-in LED. LED can be turned on by setting the value of pin HIGH and turned off by setting pin value LOW. |
Line 48: Line 49:
  
 <figure label> <figure label>
-{{https://home.roboticlab.eu/_media/en/iot-open/programming_fundamentals_rtu/arduinouno.jpg?400 |title}}+{{ https://home.roboticlab.eu/_media/en/iot-open/programming_fundamentals_rtu/arduinouno.jpg?400 |title}}
 <caption>The Arduino UNO board ((https://store.arduino.cc/arduino-uno-rev3))</caption> <caption>The Arduino UNO board ((https://store.arduino.cc/arduino-uno-rev3))</caption>
 </figure>  </figure> 
  
 <figure label> <figure label>
-{{https://home.roboticlab.eu/_media/en/iot-open/programming_fundamentals_rtu/usbcable.jpg?400 |title}}+{ {https://home.roboticlab.eu/_media/en/iot-open/programming_fundamentals_rtu/usbcable.jpg?400 |title}}
 <caption>USB cable for Arduino UNO</caption> <caption>USB cable for Arduino UNO</caption>
 </figure> </figure>
  
-==== Step 2. Downloading the Arduino software development environment +==== Step 2. Downloading the Arduino software development environment ==== 
-The open-source //Arduino Software// (Integrated development environment (IDE)) can be found in the official Arduino website ((https://www.arduino.cc/en/Main/Software)).+The open-source //Arduino Software// (Integrated development environment (IDE)) can be found in the official Arduino website ((https://www.arduino.cc/en/Main/Software)). The appropriate installation file depends on the OS of the computer and the access rights of the user.
  
 <figure label> <figure label>
-{{https://home.roboticlab.eu/_media/en/iot-open/programming_fundamentals_rtu/arduinoide.png?800 |title}} +{{ https://home.roboticlab.eu/_media/en/iot-open/programming_fundamentals_rtu/arduinoide.png?800 |title}} 
-<caption>caption</caption>+<caption>Downloading the installation file for Windows OS from Arduino original website.</caption>
 </figure> </figure>
  
-For Windows 10 OS, the //"Windows Installer"// should be clicked and then the file should be saved on the computer.+For Windows OS, the //"Windows Installer"// should be clicked and then the file should be saved on the computer. When the installation file has downloaded, the file should be run. If the ZIP file was downloaded, it is necessary to unarchive it and to run installer. Follow the instructions of the installer. If the operational system asks for permission to install the driver of the board - allow it. 
 + 
 +It is also possible to use Arduino Web Editor (can be found in the same website) to work online with the Arduino board, but this option will not be considered in this manual. 
 + 
 +<figure label> 
 +{{ https://home.roboticlab.eu/_media/en/iot-open/programming_fundamentals_rtu/arduinowebeditor.png?800 |title}} 
 +<caption>Arduino Web Editor</caption> 
 +</figure> 
 + 
 +==== Step 3. Connecting to Arduino ==== 
 +Using USB cable, Arduino needs to be connected to a free USB port of a computer. The blue LED on the Arduino board starts to shine continuously. This is the indicator that the Arduino board is working. 
 + 
 +The green LED will blink and that will indicate to the performance of the manufacturer test software. In case if the green LED is not blinking, it is not an error. 
 + 
 +==== Step 4. Starting up the programming environment ==== 
 +The Arduino programming environment can be started with the double-click on the desktop shortcut of the Arduino software. The language of the environment will respond to the one that is set up in the OS of the computer, that means if it is English, then the menu of the programming environment will also be in English language. To change the language preferences, it is necessary to follow the instructions in the following webpage ((http://arduino.cc/en/Guide/Environment#languages)). 
 + 
 +==== Step 5. Open the example program ==== 
 +In the Arduino IDE open //File->Examples->01.Basics->Blink// as shown in the image below. 
 +<figure label> 
 +{{ https://home.roboticlab.eu/_media/en/iot-open/programming_fundamentals_rtu/example.png?600 |title}} 
 +<caption>The path to open "Blink" example in the Arduino IDE</caption> 
 +</figure> 
 + 
 +This will open in the new window an example program for turning on and off green LED that is situtated on the Arduino UNO board with the 1 second delay. 
 +<figure label> 
 +{{ https://home.roboticlab.eu/_media/en/iot-open/programming_fundamentals_rtu/blinkexample.png?600 |title}} 
 +<caption>The example Blink program.</caption> 
 +</figure> 
 + 
 +==== Step 6. Choosing the microcontroller ==== 
 +In this step it is necessary to choose the type of board that is used. In this example the Arduino UNO board is used that is why in the menu of Arduino IDE choose //Tools->Board->Arduino/Genuino Uno// as shown in the image below.  
 +<figure label> 
 +{{ https://home.roboticlab.eu/_media/en/iot-open/programming_fundamentals_rtu/chooseboard.png?600 |title}} 
 +<caption>The path to choose the type of board.</caption> 
 +</figure> 
 + 
 +====Step 7. Setting up COM port ==== 
 +To ensure transmitting and receiving data to/from microcontroller, it is necessary to set the serial communication port - COM port. All ports are numbered in order and for Arduino microcontroller it is usually higher than COM3, i.e. COM4, COM5, etc. In the image below it is COM4. 
 + 
 +<figure label> 
 +{{ https://home.roboticlab.eu/_media/en/iot-open/programming_fundamentals_rtu/chooseport.png?600 |title}} 
 +<caption>The path to choose the port for Arduino connection.</caption> 
 +</figure> 
 + 
 +==== Step 8. Uploading the example program to the board ==== 
 +Now the program can be uploaded to the Arduino board using the //Upload// button in the top left corner of the software, then wait for a few seconds, during which you can see the data sending indicators - LEDs are blinking fast (indicates sending or receiving data) - and wait for the message to be //"Upload is complete"//
 + 
 +<figure label> 
 +{{ https://home.roboticlab.eu/_media/en/iot-open/programming_fundamentals_rtu/upload.png?400 |title}} 
 +<caption>Uploading program to the board.</caption> 
 +</figure> 
 + 
 +After a few seconds, the green LED will blink with a one second interval like it is written in the source code. If this is can be observed successfully then everything is done to start learning the basics of programming. 
 + 
 +In case if the blinking green LED cannot be observed, instructions for troubleshooting can be read in the following link ((http://arduino.cc/en/Guide/Troubleshooting)). 
 + 
 +If you want to get acquainted yourself with microcontroller capabilities or programming basics independently, look at one of these sources of information: 
 +  * Examples for the accompolishing tasks of different level of difficulty ((http://arduino.cc/en/Tutorial/HomePage)). 
 +  * Reference for the programming language used ((http://arduino.cc/en/Reference/HomePage)). 
 + 
 +**Check yourself** 
 + 
 +1. What power supply Arduino UNO mictrocontroller requires? 
 + 
 +2.How to operate with inputs/outputs of the microcontroller?
  
 +3. Try different examples in the menu of Arduino IDE.
en/iot-open/programming_fundamentals_rtu/setting_up_programming_environment.1515591142.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0