How to develop and debug C++ code for Arduino in Visual Studio if you are tired of the Arduino IDE

The Arduino platform has gained a fantastic popularity over the past ten years. For small quick and dirty projects, the .ino files and the standard IDE is OK. However, for professional development projects and for developers that want control over the .hpp and .cpp files the standard Arduino IDE is somewhat regarded like a toy. Furthermore there is no proper debugger in the Arduino IDE  (whaaat?, you gotta be kidding?)

Well, this has changed as Visual Micro has developed a plugin to Microsoft Visual Studio. You can write code the normal way you do it with .cpp and .hpp files. You can also run the GDB debugger. The IDE has support for the regular .INO files and Arduino libraries. Here is how both .cpp and .ino files are handled: http://www.visualmicro.com/page/User-Guide.aspx?doc=INOs-and-CPPs.html

There is a free version of Visual Micro and it works against the free versions of Microsoft Visual Studio 2017 Community Edition. All you need is a Microsoft account to be able to download and install Visual Studio 2017 Community edition. Then in MSVC 2017, go to tools, Extensions and Updates and enter a search for Arduino in the search bar. It will will offer to automatically install the Arduino tools and the GDB debugger. Click install and you are on the right path.

Links:
http://www.visualmicro.com/
https://marketplace.visualstudio.com/items?itemName=VisualMicro.ArduinoIDEforVisualStudio

If you find this tip useful, please share on facebook and share the link. Also, feel free to report your experiences in the comment field.

Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *