saving . . . saved debugging has been deleted. debugging has been hidden .
debugging
Title
Question
how debugging works in arduino?

Arduino General None min None sec 03-06-25, 10:01 a.m. sangeethak96

Answers:

Debugging in Arduino is mostly done using the Serial Monitor. You add Serial.print(); and Serial.println(); statements to your code to check the values of variables or to see which part of the code is running.

e.g. code

void setup() {
  Serial.begin(9600);  // Start serial communication
  Serial.println("Starting setup");
}

void loop() {
  int value = analogRead(A0);  // Read sensor
  Serial.print("Sensor value: ");
  Serial.println(value);  // Print value to monitor
  delay(1000); // Wait for a second
}

You can also check and debug the code using a hardware component like an LED.
Turn an LED on or off to see if a certain part of the code is executing properly.
03-06-25, 10:46 a.m. Pratikjb11


Thank you .... But what about AVR-GCC? Is that find any errors in the code while compiling?

03-06-25, 11:18 a.m. sangeethak96


When compiling the code with avr gcc, add avr-gcc-g to do the debugging of the code.
For more information on avr-gcc, type avr-gcc --help in the terminal.
04-06-25, 4:37 p.m. Pratikjb11


Log-in to answer to this question.