Build and debug Arduino sketches with Visual C++ (MSVC) and Visual Studio 2022.
I can't promise that you will get your Arduino project
running 5 times faster with this extension.
But I am sure that you will have 5 times more fun with it.
Immo Wache - Inventor of VirtualBoard
Use the Visual Studio integrated development environment (IDE) to develop, build, run and debug your Arduino sketches as an executable directly at your Windows computer. Use network and serial connections of your computer directly from your Arduino sketch. Connect to I/O, SPI and I2C pins via IO-Warrior hardware, connected via USB.
- Make up use of the super fast MSVC compiler and comprehensive Visual Studio debug features to speed up your sketch code development,
- Get a project template to obtain all required MSVC settings preconfigured for your sketch,
- Use the Arduino compatible VirtualBoard NuGet package, which provides the standard Arduino functions and libraries for your Windows sketch executable,
- Keep your sketch folder compatible with Arduino IDE or Arduino CLI and upload your sketches to real Arduino compatible boards,
- Add and use MSVC compatible Arduino libraries to your sketches or use special MSVC compatible library versions,
- Connect your running sketch simulation at your Windows computer with real I/O, SPI and I2C pins via IO-Warrior hardware.
- MSVC, used by Visual Studio differs in some C++ language features from GCC compiler, used by the Arduino IDE,
- The Windows executable uses the 32bit features of your computer CPU which differs e.g. from the 8bit Arduino Uno,
- The Windows executable also uses huge memory resources of your computer, compared to the 2K RAM size of an Arduino Uno,
- Windows is not a real time OS, so no interrupts or time critical response time is supported.
To create VirtualBoard applications for your Arduino sketches you will need Visual Studio 2022 with workload "Desktop development with C++" installed.
-
Launch Visual Studio 2022, then click
Continue without code
. -
In the Extension Manager expand the Online node and search for
Arduino
, install theVirtualBoardExtension
or download it from the Visual Studio Marketplace. -
Close Visual Studio to actual start the installation of the extension. Then restart Visual Studio again.
-
Launch Visual Studio 2022, then click
Create a new project
to start the project creation wizard. -
In the "Create a new project" wizard step search for
Arduino
and select theArduinoProjectTemplate
by double click at template or press buttonNext
. -
In last wizard step "Configure your new project" enter your project name. This will also be your Arduino sketch name and project folder name. Then press button
Create
. -
Now Visual Studio opens your new created VirtualBoard project for Arduino. In the solution explorer tree find your
sketch.h
and Arduino*.ino
sketch file. -
Also take a look at the
Application.cpp
file. This file is the main entry point of your Visual C++ project. All Arduino core libraries and your sketch file are included from here. -
Now you can start to write and debug your Arduino sketch code - Happy coding!
- VirtualBoard Installation - Install VS2022 Community Edition and the VirtualBoard extension
- VirtualBoard Sketch Creation - Use the Arduino project template to create a new or already existing Arduino sketch
- Debug a VirtualBoard sketch with VS2022
- Add additional Arduino libraries
- Connect to real I/O, SPI and I2C pins via IO-Warrior hardware