Created
December 29, 2014 00:01
-
-
Save ah01/1ddb5b17df0507759145 to your computer and use it in GitHub Desktop.
Visual Micro - debug code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "arduino.h" | |
#include <VM_DBG.h> | |
unsigned long time; | |
bool output; | |
void setup() | |
{ | |
// MicroDebug setup | |
delay(2000); | |
MicroDebug.begin(&Serial,115200); | |
MicroDebug.outPacketStart(); | |
MicroDebug.transport->print("VMDPV_1|1_VMDPV"); | |
MicroDebug.transport->println(); | |
delay(10); | |
MicroDebug.start(false,true); | |
pinMode(13, OUTPUT); | |
} | |
void loop() | |
{ | |
if (millis() - time > 1000) | |
{ | |
time = millis(); | |
// trace value of time | |
MicroDebug.outPacketStart(); | |
MicroDebug.transport->print("VMDPE_2"); | |
MicroDebug.transport->print("|"); | |
MicroDebug.transport->print(time); | |
MicroDebug.transport->println("_VMDPE"); | |
delay(5); | |
// breakpoint - wait for contrinue | |
delay(10); | |
MicroDebug.breakWait(2); | |
output = ! output; | |
// trace value of output | |
MicroDebug.outPacketStart(); | |
MicroDebug.transport->print("VMDPE_1"); | |
MicroDebug.transport->print("|"); | |
MicroDebug.transport->print(output); | |
MicroDebug.transport->println("_VMDPE"); | |
delay(5); | |
digitalWrite(13, output); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment