Arduino Introduction
Last updated
Last updated
Arduino is an open−source electronics platform based on easy−to−use hardware and software. It's intended for anyone making interactive projects. Usually, an Arduino project consists of circuit and code.
Arduino Board is a circuit board, with integrates micro controller, input, output interface and etc. Arduino Board can use the sensor to sense the environment and receive user's operation to control LED, motor rotation, etc. We just need to assembly circuit and write the code.
Currently, Arduino Board has several models, and the code between boards of different types is universal (some boards may not be completely compatible because of the differences in hardware). Popular boards include:
Digital I/O Ports is used to connect to other components or modules, to receive an input signal, or to send a control signal. Usually, we name it by adding a "D" in front of the number, such as D13.
USB Interface is used to provide power, upload code or communicate with PC.
LED L is connected to digital I/O port 13 (D13).
LED TX, RX is used to indicate the state of the serial communication.
DC Power Jack is connected DC power to provide power for the board.
Power Ports can provide power for electronic components and modules.
Analog I/O Ports can be used to measure analog signals.
LED ON is used to indicate the power state.
Arduino Software (IDE) is used to write and upload the code for Arduino Board. First, install Arduino Software (IDE): visit https://www.arduino.cc, click "Download" to enter the download page.
Download corresponding installation program according to your operating system. If you are a Windows user, please select the "Windows Installer" to download and install the driver correctly.
After the download completes, run the installer. For Windows users, there may pop up a installation dialog box of driver during the installation process. When it is popped up, please allow the installation. After installation is complete, an Arduino Software shortcut will be generated in the desktop. Run the Arduino Software.
The interface of Arduino Software is as follows:
Programs written using Arduino Software (IDE) are called sketches. These sketches are written in the text editor and are saved with the file extension .ino. The editor has features for cutting/pasting and for searching/replacing text. The message area gives feedback while saving and exporting and also displays errors. The console displays text output by the Arduino Software (IDE), including complete error messages and other information. The bottom righthand corner of the window displays the configured board and serial port. The toolbar buttons allow you to verify and upload programs, create, open, and save sketches, and open the serial monitor.
Additional commands are found within the five menus: File, Edit, Sketch, Tools, Help. The menus are context sensitive, which means only those items relevant to the work currently being carried out are available.
Open the example sketch "Blink" with Arduino Software.
Select board "Arduino/Genuino Uno".
Select the serial port. Your serial number may be different from the following figure. If it is not detected immediately, please wait for a while, then click "Tools" to check again.
Click "Verify" button.
Wait a moment for the compiling to be completed. Figure below shows the code size and percentage of space occupation
Usually, when we write code, if it has a syntax error, the interface will prompt the error message. Then the compiling can't be completed. Click "Upload" button
Wait a moment, then the uploading is completed.
After that, we will see the LED marked with "L" on UNO starts blinking. It indicates that the code is running now!