I'm with Arduino, and why write this series of articles
Arduino has been on fire for years, and it's not a new technology. If someone is not clear about what Arduino is, I'm sorry, please search by yourself, open any Wikipedia introduction or a fan of the series of articles, people introduced more than I know more comprehensive. I'm afraid I don't have to repeat it here.
The first contact with Arduino was in 2008, then I know nothing about embedded development, just started to learn MCU, that is, at that time noticed the Arduino, it really can let me quickly in the 8-bit AVR microcontroller running a simple small program, quite a little sense of accomplishment. But later, it soon lost interest in Arduino. Because:
- In fact AVR microcontroller development is also very simple, once mastered the AVR microcontroller development, it seems to use the situation of Arduino less;
- Although the Arduino is a good shortcut, it also has many limitations, such as its I/O operation is 50 times times slower than the native Atmel SDK;
- Standing on an engineer's point of view, it seemed to me that Arduino was a little too simple, too "toy" and not "engineered". In particular, I would like to be criticized for this when it comes to more complex procedures.
Time flies, all of a sudden to 2016 years, did not expect in my current company inside, and someone mentioned Arduino. And initially criticized the Arduino not enough "engineering" aspect, seems to have a solution now, let me have to re-pick up the idea of Arduino, so there is a series of small articles. In fact, I know about Arduino is not deep, if there is any place is not correct, you are welcome to enlighten me, thank you!
Notes: about how the word "Arduino" should be read, reading from around me is a varied and correct way to read it here: the English pronunciation of Arduino
Let's start with the nonsense.
Building the most basic Arduino development environment hardware: Arduino Development Board
First you want to have an Arduino development board, this thing is now extremely cheap, a treasure on a search a lot of, cheap 20 yuan or so, a little more than 30 or 40 yuan, not like I would spend hundreds of dollars. If you do not have, today in a treasure to order, choose the same city business, the general arrival tomorrow.
I recommend this model: Arduino Mega 2560 R3.
Why this model? Because it has more Flash and RAM than the other Arduino development boards, so you don't have to be big enough to write a program in the future.
For the Arduino Development Board selection, let's compare the two most common models: Arduino UNO-R3 and Arduino Mega 2560 R3
From the above comparison, the Mega 2560 advantage, self-evident bar.
For information on how to choose the right Arduino Development Board, you can refer to this: https://www.sparkfun.com/arduino_guide
Arduino Mega 2560 R3 This board is this countenance (can be described as well-done, Yan value is quite high):
This series of articles generally uses the Arduino Mega 2560 R3 as an example, but these examples are generally not modified to run on other models of the Arduino board.
Software: Arduino IDE
The Arduino development environment (Arduino IDE) has been largely unchanged since 2008 when it came to Arduino. Now let's install this software, in the subsequent article, we will not just satisfied with the IDE, will introduce more advanced tools and more "engineering" play.
Go to the Arduino official website to download the latest version of the Arduino Ide:https://www.arduino.cc/en/main/software
At this point the latest version of the Arduino IDE is 1.6.9. Readers from the future, I do not know when you read this text in the use of what version, then the Arduino IDE will have become let me not recognize it.
The IDE is written in Java and can be used across platforms, Windows, Linux, Mac OS x. Its built-in compiler is GCC.
There's nothing to say about the installation process under Windows, all the way next. I've installed it on both 32-bit and 64-bit Windows 7, Windows 8.1, and Windows 10, and there's nothing incompatible. (Only Windows XP has not tried.) )
When installing, the installation option is recommended to select all, especially the USB driver, and we can't play without it.
Installation path I did not use the default C:\Program Files (x86) \arduino, I gave it a specific directory: C:\Application\x86\Arduino\v1.6.9. Why did you do it? First of all, I hate the path with spaces; second, we might have the opportunity to try multiple versions of the Arduino IDE coexistence, so let's now separate the versions with the path.
Installation of the time, usually encountered such a hint to install the driver, we can certainly from it:
Installation Complete:
Run for the first time
All we have to do now is to use the USB cable to connect the Arduino Development Board to the computer:
The device can be successfully identified as long as the driver installation is successful:
Open the Arduino IDE, and from the Tools menu, set Board, Processor, Port as your current situation:
Then we open the small example of the Arduino Blink (this example does not need any external devices, directly with the yellow light on the Development Board to complete the demonstration):
We want to look at the Toolbar of the Arduino IDE:
Click on the "Verify" icon to verify that the program is compiled by:
Then click on the "Upload" icon, the role of this icon is to compile the program and then upload the program to the Development Board:
If everything is OK, you will be prompted to compile successfully in the message window, and then upload successfully. If there is an error in the message window, then you need to deal with the specific problem.
You can then observe that the yellow LEDs on the Development Board are continuously illuminated and extinguished at 1-second intervals.
Even if you disconnect the board from the computer, and then just give it the correct power, the yellow led on the Development Board can still be lit and extinguished in 1 second intervals. The program has been uploaded to the Flash of the Development Board and can be physically run off the Development Board from the development environment.
The basic article is introduced here first. Next, we'll start moving into real high-level articles, such as configuring Visual Studio as the Arduino development environment to replace the less powerful Arduino IDE. May still be interspersed with some basic knowledge of the introduction, to see my mood. ^-^
Arduino Advanced Tutorial 01: Basic article