Breakpoint Conditional Expressions
What Breakpoints Conditional Expressions Can be Used For
You can specify, which information from your program (values of variables
etc.) shall be transmitted to Visual Micro when the breakpoint is hit.
This can be a fixed text as well as values of variables. You can also change the
variable's values on your PC and then can instruct the board to continue
executing while using the new variable value.
After making changes to your breakpoint
as shown here, you
must
recompile and upload your sketch in order for the changes to go into
effect.
How to Create a Breakpoint With a Conditional
Expression
Read on the general Breakpoints documentation page on how to set breakpoints.
To make a breakpoint conditional, right click the
marker of an existing breakpoint at the left of your code, and choose "Conditions...":
or click on the
icon,
that appears when you mouse cursor hovers over the red
breakpoint marker.
An new window appears, showing these text fields::
First you choose what mode of conditional expression you want to use.
A Conditional expressions
"Conditional expression" lets you check an expression.
Enter the expression in field
exp . You can use variables from your sketch in the expression, e.g. "inputVoltage > 100"
assuming "inputVoltage" is one of your variables. Any expression that is valid at the code location of your breakpoint can be used, including function calls,
for example: "myFunction(analogRead(SIGNAL_PIN)) > limit[i]"
1 and
2:
Choose either "Is true" or "When changed".
- With "Is true", the breakpoint will become effective
if the condition is true, e.g. if "inputVoltage" is greater than
100.
- With "When changed", the breakpoint will become effective
if the given expression's result has changed since the last time the
breakpoint was passed. "Has Changed" also makes
sense without a comparison (>,<,==, etc.), for example, if your
expression is "inputVoltage", then the breakpoint halts, if the
inputVoltage has changed since the last time the breakpoint was passed.
B Hit
Counters
Read on this page dedicated to Hit Counters.
C Filters
Filters cannot be used with Visual Micro, they are reserved for development using Visual Studio alone.