The Programino IDE debugger for Arduino™ is a powerful and easy to use universal serial inline debugger. It works with all Arduino compatible board, also with the ESP8266, ESP32 or Controllino. In this example used the Arduino UNO.
It does not require any additional hardware to use.
The debugger generates its own debug code.
This allows variables (even entire functions or calculations) to be viewed at runtime.
Breakpoints allow the programme to be stopped at desired points and to wait until it is continued by the user.
Breakpoints allow the programme to be stopped at desired points and to wait until it is continued by the user.
The annoying insertion of Serial.println() is no longer necessary.
The available debugger functions:Add Breakpoint: Insert breakpoint in the line of the cursor.
Remove Breakpoint: Remove breakpoint in the line of the cursor.
Remove All Breakpoints: Remove all breakpoints in the file.
Add Debug Variable: Add selected variable.
Remove Debug Variable: Remove the marked variable.
Remove All Debug Variable: Remove all debug variables in the file.
With the help of a small example, you can now see how to use the debugger.
To add a breakpoint, do the following:Click with the mouse on the line where the breakpoint is to be inserted.
- Click with the mouse on the line where the breakpoint is to be inserted.
- Press the right mouse button to open the context menu.
- Select "Add Breakpoint".
- The breakpoint has been set. A red dot with an arrow is displayed at the location of the breakpoint.
Repeat this also in the "2ndFile.ino" of the example as shown in the figure.
Now all variables and breakpoints have been added.
To generate the debug code, press the icon with the "beetle" in the menu above.
The debug code is now generated.
The original code is not changed, the debug code is saved in a separate location!
(1) Generate the debug code.
(2) Start the debugger.
(3) Continue to Breakpoint until the next breakpoint.
(4) Stop debugging.
Make sure your Arduino™ board is connected to the IDE (Board and Comport).
- Generate the debug code.
- After upload the programm to the Arduino™ board, start the programme with the "Play" icon.
- The programme runs to the first breakpoint and stops there.
- To continue, click on the icon with the "arrow to the right".
- The programme continues until the next breakpoint.
- Continue and watch the output until you have reached the very first breakpoint again.
- Now you can end the debugger with the "Stop" icon.
The debugger uses the serial interface for communication.
Outputs with serial.print() are also displayed in the right output window during debugging.
If you press CTRL + SHIFT + W on your keyboard, you can open the path of the debug code.
You can also add whole functions or calculations to the debugger output.
To do this, select the area you want to output and add it as a variable. In the example "analogRead(A0)".
Make sure that the brackets are also properly marked!/******************************************************************
Created with PROGRAMINO IDE for Arduino
Project : Debugger
Libraries :
Author : UlliS
Description : Debugger Example
******************************************************************/
int t = 0;
int LED = 13;
void setup() {
// write your setup code here, to run once
pinMode(LED,OUTPUT);
Serial.begin(19200);
}
void loop() {
// write your main code here, to run repeatedly
for(int i = 0 ; i < 10 ; i++) {
// --> add debug variable i
t++;
// --> add debug variable t
digitalWrite(LED,HIGH);
delay(20);
digitalWrite(LED,LOW);
delay(20);
}
// --> add a breakpoint her
for(int i=10;i>0;i--) {
// --> is already in the list. How do you want to monitor at this point too!
digitalWrite(LED,HIGH);
delay(20);
digitalWrite(LED,LOW);
delay(20);
}
test();
// --> add a breakpoint her
}
2ndFile.ino/******************************************************************
Created with PROGRAMINO IDE for Arduino
Project : Debugger
Libraries :
Author : UlliS
Description : Debugger Example
******************************************************************/
int j = 0;
void test() {
// --> add a breakpoint her
int analogA0 = analogRead(A0);
// --> add debug variable analogA0
Serial.print("A0 = ");
Serial.println(analogA0);
delay(50);
j++;
// --> add debug variable j
}
Comments