Configure the arduino environment plug-in for Visual Studio 2022 and write arduino code under VS

In vs20017, I published a blog post " Introduction to an arduino plug-in Visual Micro (Arduino IDE for Visual Studio) under Visual Studio"" Slowly found that many people want to use this plug-in to other versions of VS and it doesn't work. So I wonder if I can introduce to you an arduino plug-in for vs2022?
The answer is yes!


Original source of the article: https://blog.csdn.net/syzcyyx/article/details/129600469

1. Discover the plugin

Through the management extension menu under the "Extension" of Visual Studio 2022, let's search for it, and sure enough, although it is a trial, it does not mean that it cannot be used. If you can try it, don't you know?
insert image description here
Click to download and install decisively, let's try it! But it seems that the download is not very smooth, it is relatively slow!
insert image description here
If you really feel that it is too slow to download, you can go to its site to download it directly
. I will post the address here: https://visualmicro.gallerycdn.vsassets.io/extensions/visualmicro/arduinoideforvisualstudio/2023.220.2205/1677852027601/Visual. Micro.Arduino.Studio_2023_0320_2205.vsix
recommends that you copy it and download it in Thunderbolt, which is faster than downloading it in the browser!
insert image description here

2. Installation and trial

1. Installation

After downloading, we will get a Visual.Micro.Arduino.Studio_2023_0320_2205.vsix file. vsix is ​​the extension file name specially installed for the extension of vs. The advantage is that it can be installed successfully without closing VS. But I still recommend installing after closing, because the plug-in also needs to configure the environment, especially the arduino plug-in.
insert image description here
The installation is not difficult, so there is nothing to say, but it needs to download something during the installation process, so the speed is not very fast.
insert image description here
insert image description here

2. Trial

Open our VS2022, search for arduino on the right side of the new project, you can see it, we choose an empty project to test the
insert image description here
first use, you need to download the work to meet, use C++ for linux and embedded development, I will download it directly Yes, to avoid subsequent troubles
insert image description here
The first time you enter, you will be asked to activate in the vMicro Menu under the extended menu, so you just do it, there is no choice. If you do not have an activation code, you can only choose to try it on the activation interface
insert image description here
insert image description here
. If you encounter such a prompt, it means that you have not configured the location of the arduino IDE.

insert image description hereDon't be lazy, go configure it, otherwise you will encounter such a situation, whether you don't know the pinMode!

insert image description here
Click Visual Micro Explorer to configure the Arduino IDE.
insert image description here
In the drop-down box of the IDE, you can see Arduino2 by default. This is a new Arduino version. If you are not familiar with it, you can still try the old version, 1.8. Click IDE Locations next to rescan to continue configuring
insert image description here
insert image description here
mine is 1.8 IDE, so I still choose this version of IDE, I don’t want to download the new version of arduino IDE, I have configured the IDE path, but if you have special For the downloaded library file directory, you must remember to configure it in the second text box below. If you still use other boards for arduino development (such as using stm32 boards), you must configure the path of the third text box.
insert image description here
Well, if you feel that everything you need to configure is configured, you can click OK, and we are going to start work. Back in VS, you must remember to choose the IED version, the arduino version, here I choose the most common UNO, and the port number (if you have plugged in the arduino version, there will be a serial port number)
insert image description here

3. Compile and upload

Let's make the simplest program, blink, to test whether the compilation and upload can be successful. The one on the left is compiling, and the one that looks like the play button is compiling and downloading. Remember not to click VS to run.
insert image description here
Similar to the display below, it means that your upload is successful. Although there is no upload successful that you are familiar with, the upload is indeed successful. At this time, you can see that the 13th light is flashing on your board.
insert image description here
And you can also see its running status in VS, switch the display output source to Micro Debug Trace.
insert image description here

Three, afterword

By trying Arduino IDE for Visual Studio 2022, I feel that it is more powerful than the 2017 version (from its official website homepage, it still supports vs2017 to vs2023), if you are used to VS as an editor for children's shoes, you can consider migrating Come to VS.

1. Debug function

It seems that it also supports debug, and the introduction on the official website fully supports various functions of arduino IDE.
insert image description here

2. Open the serial port debug

The debug function is opened on the side of the serial port selection drop-down box. After clicking, two small windows will be displayed. One shows the status of the serial port open and closed, and the other is the window for running debug.
insert image description here

3. About the trial period

Although we are choosing a trial now, it seems that there is no time limit, which means that we can use it temporarily and for a long time.
Creation is not easy, reprint and indicate the source: https://blog.csdn.net/syzcyyx/article/details/129600469

Guess you like

Origin blog.csdn.net/haigear/article/details/129600469