Share The Arduino Serial Port With The Debugger

by Visual Micro 5. May 2012 17:16

The example below shows a single Arduino Serial Port being used for both debug and static serial messages.

The example goes one step further by making use of the DEBUG symbol allowing the static messages to only be included in the program when debuging is enabled for the project.

Notes

In the example above the code in the Serial.begin() in the setup() function is not required because both the debugger and the project are using the same port. However, if the defined(DEBUG) condition is removed from the code then Serial.begin() would be required. Therefore it is safer to add Serial.begin() if your sketch code directly uses the Serial port.

The same would apply if the debug "Remote Port" on the project properties was set to a port other than "Serial". In this case you would certainly need to initialise the Serial port.

Arduino Code Object and Class Browser

by Visual Micro 2. May 2010 14:17

The visual studio object browser simplifies browsing of arduino/wiring libraries, custom libraries and your own code.