Menu

Breakpoints

Vanyamba Software

After the initialization made and variables added to the watchlist, you can use breakpoints, adding the breakpoint() function call with any type identifier that appliable to call with Serial.print().

void loop() {
  ++count;                      // Incrementing counters by one.
  ++lcount;
  breakpoint("counters watch"); // Breakpoint.
  if (count & 1)                // Changing string value with odd counter value.
    text = "Example";
  else
    text = "Debug";
  breakpoint("text watch");     // Another breakpoint.
  if (count & 5)                // Blinking the LED fast enough to step debug.
    digitalWrite(LEDPIN, HIGH);
  else
    digitalWrite(LEDPIN, LOW);
}

NB. Don't attempt to call breakpoint() function from interrupt handlers, it won't work.

[Debug session with Simple Dumping Monitor]


Related

Wiki: Debug session with Simple Dumping Monitor
Wiki: Home
Wiki: Library initialization