Know your Arduino Device, meet the Future of Tech
It integrates all the environments and support libraries required for Arduino development. You only need to select the development board and then click a few mouse clicks to realize functions such as compilation, programming, serial port monitoring and so on.
In addition, Arduino has also launched a web editor and Arduino CLI in recent years, which further lowers the development threshold for Arduino.
If you don't like Arduino or want to use other IDEs, you can also choose to install the VSCode+Platform IO plug-in for development. Platform IO also provides the environment required for most embedded development including Arduino, and can also realize one-click compilation and download. ,debugging.
Note: This tutorial uses the Arduino IDE for explanation and demonstration.
1.4 Configure the environment
There are already a lot of tutorials for version 1.8 on the Internet, because the v1 version is not very good for code auto-completion.
Therefore, here is a demonstration of the Arduino IDE 2.0 RC version on the Windows operating system.
Official download address: https://www.arduino.cc/en/software
After entering the download website, slide down the webpage to see the download entry of Arduino IDE 2.0 RC:
Since the server is located abroad, the download speed may not be very fast, so be patient
After downloading, follow the prompts to install and start the program, you can see the following interface:
Note: everyone's color matching may be different here, the default is white text on a black background, which can be changed at File->Preference->Theme
Let's click on "Board Support Library Management" to install the "Arduino AVR Boards" library:
Warning: Due to the problem of the Arduino CLI itself, errors such as Access is denied may appear here. At this time, you need to close the anti-virus software before installing it normally! ! !
During this process, the driver will be installed automatically, please select "Yes" in the prompt to confirm
After the installation is complete, the following text output should appear:
After the driver installation is complete, plug in our development board, and then select from the Development Board Selection drop-down box:
According to the different USB ports you connect, this is not necessarily COM3, you need to judge by yourself. Or check the serial port in the device manager, or plug and unplug the development board to see which COM port is newly added.
1.5 Running the code
Let's run a piece of code for lighting, similar to "Hello World", everything starts with lighting!
After selecting the development board, copy the following content to the edit window:
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
delay(300);
digitalWrite(LED_BUILTIN, HIGH);
delay(300);
digitalWrite(LED_BUILTIN, LOW);
}
It doesn't matter if you don't understand this code at present, there will be a line-by-line explanation below.
Click the Burn button, the terminal will display the following prompt:
And the LED on the board starts blinking:
At this point, the environment has been successfully configured!
2. See the Way (Get Started)
Here's how to write the Arduino code.
The Arduino library is written in C++, and many functions are officially packaged into functions, but for beginners, you don't need to know so much, as long as you have a little C language foundation, you can use it smoothly.
The Arduino library shields the low-level details of the AVR microcontroller, so that we can easily get started even if we don't know about analog-to-digital electricity or microcontroller-related knowledge. Now let's briefly understand the Arduino language-related content.
Leave a Comment