Getting Visual Studio 2010 to work as a IDE

Newbee needs help> thanks...
I need help getting Visual Studio 2010 working with Arduino. Using the Playground guide.

Can someone tell me how to modify the VSPDE.h file to include the nano board?
Per guide “If you need support for other boards you need to edit the VSPDE.h file. “

Step 3: Create a Visual Studio project

  1. Start by creating a new (empty) sketch using the Arduino editor
  2. Next create a Visual C++ ‘Empty Project’ for the sketch in the same folder
  3. In the solution, right click and select Add, Existing item to add the .PDE file(s) or .INO ?
  4. Select the .PDE files, right click and in the file properties set the file type to ‘C/C++ Code’
  5. Add the VSPDE.h and VSPDE.cpp files ; To what directory?
  6. In Studio 2010, make sure the VSPDE.cpp/.h are saved as US-ASCII and not UTF-8 or Unicode. Otherwise Arduino 1.0 will fail compilation due to the BOM marker. IN VC++ 2010 Express, this is done as follows. Open the file, then Save As. In the Save As dialog, click on the down-arrow on the right of Save and select Save With Encoding, agree that you want to overwrite the file, and select ‘US-ASCII - Codepage 20127’ for the encoding.
  7. Add an #include statement for the VSPDE.h file in the .pde files. .INO ?
  8. You can now edit, compile and run the program as a console application (without I/O support!)

Does someone have an sample sketch that shows how VSPDE.h is added ?

I have implemented the Visual Studio Plugin into my Visual Studio 2010. But need debugging.
Can it be used in Visual Studio 2010 at the same time as the VSPDE.h fix ?

Hello,

It is great to hear you are using the Visual Studio plugin.

If you register for the plugin forum on visualmicro.com you will be able to get some help. I am sorry that we do not monitor other forums because it takes too much time for a free tool. In fact I just stumbled upon your post by accident :slight_smile: You will find the register link at the top of the site.

To answer your question:-

There is a property called "Release Configuration" in "Tools>Options>Visual Micro>Compiler" which does what you want it to do. If, for example, you enter "Release" in this property then the Arduino compile will only happen when the Visual Studio solution configuration is set to "Release". This means that you can set the visual studio solution configuration to, for example, "Debug" and the Arduino compiler functionality will be disabled giving a normal Win32 compile.

C++ include paths are not automatically maintained when the Arduino compiler is disabled, allowing you to set the paths yourself.

This feature has not been tested fully since the release of the arduino debugger beta upgrade (see below) so if you have a problem please join our forum and report it. Thanks

It is quite difficult to do what you want to do. If you make a working system we would love to hear about how we might include this as an option in the free visual studio plugin. So again please join the forum and let us know how you get on!

The final beta for the first easy to use arduino debugger has been released. It is a visual studio toolkit for the plugin that you already have installed and includes open source .NET debugger visualizations. You, everyone, is welcome to get a free copy and help with the beta program. It includes lots of useful tools and makes debugging arduino easy and fun.

To join the beta team email beta [at] visualmicro.com or include a request with your forum application.

Step 3: Create a Visual Studio project

  1. Start by creating a new (empty) sketch using the Arduino editor
  2. Next create a Visual C++ ‘Empty Project’ for the sketch in the same folder
  3. In the solution, right click and select Add, Existing item to add the .PDE file(s) or .INO ?
  4. Select the .PDE files, right click and in the file properties set the file type to ‘C/C++ Code’
  5. Add the VSPDE.h and VSPDE.cpp files ; To what directory?
  6. In Studio 2010, make sure the VSPDE.cpp/.h are saved as US-ASCII and not UTF-8 or Unicode. Otherwise Arduino 1.0 will fail compilation due to the BOM marker. IN VC++ 2010 Express, this is done as follows. Open the file, then Save As. In the Save As dialog, click on the down-arrow on the right of Save and select Save With Encoding, agree that you want to overwrite the file, and select ‘US-ASCII - Codepage 20127’ for the encoding.
  7. Add an #include statement for the VSPDE.h file in the .pde files. .INO ?
  8. You can now edit, compile and run the program as a console application (without I/O support!)

Does someone have an sample sketch that shows how VSPDE.h is added ?

Other Answers...

  • .Ino or pde it doesn't matter
  • Add all files to the current project directory
  • Add include into which ever (ino/pde) file you have created

The Arduino for Visual Studio Plugin Team :slight_smile: