In May 2012 a unique serial debugger for Arduino was released in beta and has recently been updated to include the ability to change the values of variables while an Arduino is running.
In the image above you can see the entire code of a very crude (rubbish) Arduino program that is running a debugging session. You can see that the trace messages and variable values are different to those defined within the compiled program.
Approximately 300 people have joined the beta program. Feed back has been really great.
The debugger integrates seamlessly into the Visual Studio IDE providing conditional breakpoint, trace and expression watch features. Unlike a conventional debugger, the Arduino is not required to break (pause) to enable variable values to be altered (optional).
We can use any available Arduino code to conditionally apply breakpoints.
Complex or simple debug messages can be generated without the need to include the text of the messages in the final Arduino program. For most users this prevents the programs from becoming "bloated" with text/debug messages
APM FastSerial is fully supported. Debug using xbee is also supported but you should not fly a debug version without first becoming very familiar with how the debugger works. (If you are unsure then talk it over with us in the Forum). The image below shows a running apm debug session that is sharing the main serial port with the apm code. This is optional, we can share or use any arduino serial port (in most cases) or use other Arduino technologies such as SoftwareSerial.
The Arduino debugger is currently being distributed for free to anyone who would like to join the beta program. You can join the program by registering for the Visual Micro forum and including a request for the debug tool.
If you don't have a copy of Visual Studio Professional this article explains how to get a 3 year licence for free.
If you do use the debugger for an apm project (or with an apm example) then you will find a few tips for configuring an apm debug session here
The debugger is an upgrade to the free Arduino plugin for Microsoft Visual Studio Professional. Further reading, small wiki and a YouTube example can be found at visualmicro.com
The debugger optionally supports open source visualizations allowing us to create graphical controls that represent the various sensors of our Arduino projects