Arduino + C++: "Quick Start" with VS2008 Express


I updated the Interfacing with Software Wiki page with a much easier out-of-the-box start using Visual Studio 2008 Express Edition to communicate with Arduino over serial. It has been a long time since I wrote a low-level program, thus, it would have taken me forever get serial communications working. For those that don't want to spend any money, and aren't software savvy, this is probably the quickest way to start hacking with serial communications.

It's located here:

I do just reference an existing Arduino sketch in the steps, but in the future I'll create a stand alone example. It took me about 15 minutes (after installing VS2008 ) to get this working. I'm sure you can replace "C++" with any other .NET supported language and it'll work fine. I think I might experiment with doing this through a webservice.

I will be looking to expand this page:

So that you can create, edit, compile, debug and burn code to the Arduino. The idea is you will be able to create a solution with two projects in it: PC side and Arduino side. This way should provide a much lower "cost to entry" to full hacking capability of the newest users!

Here is a very brief outline of the steps: - Download and Install Visual Studio 2008 C++ Express Edition - Create a CLR "Windows Form" Project - Add Serial Port interface for your board - Create controls on the form and send the data to serial port. - Create Arduino code to receive data

Quite neat! I look forward to trying this once I get back in front of my computer. However, I noticed that your example was for a GUI windows app. Do I have to do anything if I want to incorporate your code into a program that doesn't have any interface at all, or can I just use the header and cpp files (i.e. without adding a component from the toolbox)?

No, I guess it doesn't work without the Windows Form. On the other hand, I don't program much C++, so I don't really understand how I should be using it. Could you post a quick code snippet for using it as pure compiled C code, instead of linking it to a button component?

His code is based around a GUI (Windows Forms application), but I believe that both the command-line style applications and the Windows Forms applications are .NET supported, meaning I think you can do the same with the command-line. It would take a very slight bit of tweaking, but you follow essentially the same steps - make a new project (not Windows Forms), drag on the Serial Port handler, and use the 3 lines he told you to copy and paste to hook on to the proper port and send a message. You'll probably want to wait for user input before running the command though.

Are you planning on expanding the functionality to include reading from the Arduino as well? I'm going to experiment with that, let me know if you get anything to work well. Thanks so much!