This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:iot-open:programming_fundamentals_rtu:setting_up_programming_environment [2018/01/11 10:11] – Agrisnik | en: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 33: | Line 34: | ||
| 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 // | | 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 // | ||
- | | 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 | + | | 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 |
| SPI: 10(SS), 11(MOSI), 12(MISO), 13(SCK) | | SPI: 10(SS), 11(MOSI), 12(MISO), 13(SCK) | ||
| 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:// | + | {{ https:// |
< | < | ||
</ | </ | ||
<figure label> | <figure label> | ||
- | {{https:// | + | { {https:// |
< | < | ||
</ | </ | ||
Line 61: | Line 62: | ||
<figure label> | <figure label> | ||
- | {{https:// | + | {{ https:// |
< | < | ||
</ | </ | ||
Line 70: | Line 71: | ||
<figure label> | <figure label> | ||
- | {{https:// | + | {{ https:// |
< | < | ||
</ | </ | ||
Line 83: | Line 84: | ||
==== Step 5. Open the example program ==== | ==== Step 5. Open the example program ==== | ||
- | In the Arduino IDE open // | + | In the Arduino IDE open // |
<figure label> | <figure label> | ||
- | {{https:// | + | {{ https:// |
< | < | ||
</ | </ | ||
Line 91: | Line 92: | ||
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. | 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> | <figure label> | ||
- | {{https:// | + | {{ https:// |
< | < | ||
</ | </ | ||
+ | |||
+ | ==== 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 // | ||
+ | <figure label> | ||
+ | {{ https:// | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | ====Step 7. Setting up COM port ==== | ||
+ | To ensure transmitting and receiving data to/from microcontroller, | ||
+ | |||
+ | <figure label> | ||
+ | {{ https:// | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | ==== 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 //" | ||
+ | |||
+ | <figure label> | ||
+ | {{ https:// | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | 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:// | ||
+ | |||
+ | If you want to get acquainted yourself with microcontroller capabilities or programming basics independently, | ||
+ | * Examples for the accompolishing tasks of different level of difficulty ((http:// | ||
+ | * Reference for the programming language used ((http:// | ||
+ | |||
+ | **Check yourself** | ||
+ | |||
+ | 1. What power supply Arduino UNO mictrocontroller requires? | ||
+ | |||
+ | 2.How to operate with inputs/ | ||
+ | |||
+ | 3. Try different examples in the menu of Arduino IDE. |