I prefer to use the Visual Studio 2008 environment to write and test code for the Arduino. The following steps outline what is necessary to accomplish this.
Note that this requires two files to be added that are stub’s for the normal Arduino functions. The stubs provided here use defines for the Arduino Mega and create a simple console application that will map console input/output to the Arduino serial input/output.
For those of you who have more time at hand, it would be nice to write a windows stub which will also allow to see / control the I/O pins.
If you need support for other boards you need to edit the VSPDE.h file.
Also the VSPDE.cpp file does not implement all the Arduino functions, so if you need more, please feel free to update the code.
Main objective for me was to be able to edit and compile, and in a limited way run and debug code using Visual Studio. This will do just that (and nothing more)!
Open regedit and under \HKEY_CLASSES_ROOT create a new key called “.pde” and change the default value to “cppfile”.
[HKEY_CLASSES_ROOT\.pde] @="cppfile"
Under File\Preferences set the ‘Use external editor’ checkmark. Now you can use Visual studio to edit and when done just Alt-Tab to the Arduino application and press the upload button to compile the latest code and upload it to the board. The Arduino program will automatically monitor for file changes so you do not need to refresh anything!