Questions tagged [debugging]

The process of finding and resolving problems ('bugs') in a hardware and/or software system.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
129 views

Large arrays crash the arduino

I have three large PROGMEM arrays, in order to store musical notes for a song. One array is the notes, one is the note durations, and one is the pause after the note. The first array is an int one and ...
3 votes
3 answers
2k views

How to get rid of low quality sound out from DFPlayer plus amplifier?

I use my Seeeduino V4, DFPlayer mini, and this speaker module from AliExpress to create an automatic doorbell. The problem is that it seems that this speaker module's Yurobot amplifier is not ...
1 vote
0 answers
114 views

Code works in Arduino Web editor but not in PlatformIO IDE or Arduino IDE with board Nicla Sense ME

Here is the verbose for the Arduino IDE: Flashing with command:/Users/hakan/.arduino-create/arduino/openocd/0.11.0-arduino2/bin/openocd -d2 -s /Users/hakan/.arduino-create/arduino/openocd/0.11.0-...
2 votes
2 answers
4k views

Using Serial Plotter with Visual Studio Code

I'm using the Visual Studio Code extension to develop for Arduino which works great. It doesn't have a Serial Plotter like the regular Arduino IDE, which I need to debug this project. I can run the ...
-1 votes
1 answer
877 views

Debugging a Nordic MCU (feather NRF52) using Segger J-Link

I have an Afafruit NRF52 board with SD 132 and 5.1 dual fw bootloader. I implemented RTT logging and controlling (input) and the code is compiled using arduinoBuilder with RTT and debug level 3. The ...
1 vote
1 answer
64 views

don't save on tab

Ok, I made some changes to the code and I wish they would see it. At the moment the program has a bug, it is not saving the contents of the txt file to the table, can someone give some lights? #...
1 vote
0 answers
41 views

Need help with debugging a heartrate/filter code (the heart rate calculation does not work)

The code below is a program that aims to apply the Pans-Thompskin algorithm to a signal attained from a ECG filter. The filter seems to work alright but it fails to blink the LED and collect a correct ...
1 vote
0 answers
255 views

Adding Serial2 ends up blocking nano rp2040

Background Info I want to have two serials in my arduino nano rp2040 connect, in order to be able to communicate using the following scheme. (μC is a microcontroller). μC1 <--> μC2 <--> ...
2 votes
1 answer
3k views

Simple LCD countdown timer

I tried to modify the basic "hello-world" sketch for the LCD that is a part of the examples section in the IDE. I intended to make a countdown timer using the LCD. The original code simply ...
3 votes
1 answer
125 views

Simulating a button press using the Serial Monitor to run a Servo

I'm kind of new to Arduino and C, and I was having trouble with this sketch. I'm working on a project to control 6 servos using virtual buttons. When I hold down the button, the servo moves forward ...
2 votes
0 answers
64 views

How would I link inline debugger with esp32 on Mac?

I am trying to connect JTAG debugger to my esp32 according to the following steps https://www.instructables.com/How-to-Use-a-Debugger-on-an-ESP32/ but still I am facing issue in debugging. I am ...
-1 votes
1 answer
45 views

'for loop' seems to change the execution of pow()

The first time, pow() works. But inside of a 'for loop', or again afterwards, it doesn't behave !? (I'm using a Chinese Pro Mini with Arduino 1.8.16) EDIT To clarify what I am asking, my question is:...
2 votes
2 answers
1k views

Can't Upload Sketches to Arduino Nano Every

first-time builder here. I just got my Arduino Nano Every in the mail from Mouser, and I'm trying to upload a modified version of the blink example to my new brand-new board. However, every time I ...
1 vote
0 answers
64 views

How to debug an error which occures after a long time only?

I've got an ESP32 with an CO2 sensor attached. The Arduino script I'm using is quite old and worked for sending them over LoraWAN to TTN and is stable. I added an Wifi-Client to read data more ...
1 vote
2 answers
3k views

Multiple MFRC522 RFID reader on Uno bugs

I have a problem! I need to connect 5 MFRC522 readers on an Arduino Uno but it is not working ! With one or two MFRC522 modules it works, when I use three or more nothing works anymore... The serial ...
2 votes
2 answers
8k views

Proteus - How to Debug Invalid Opcode?

While running a program compiled in the Arduino IDE 1.8.5 and then using the .ELF file inside LabCenter Proteus 8.0, for an Arduino Nano ATMEL Mega 328P, for a code involving the use of the ...
4 votes
1 answer
52 views

Custom LED toggling function: one out of three LEDs misbehave

I connected three LEDs to an Arduino Uno and wrote a simple LED class. I toggle all the leds the main loop, but for some reason one led (connected to pin7) always misbehaves, skips one toggle or stays ...
1 vote
1 answer
367 views

Custom assert() implementation: not printing the error message

I am writing my own assert() macro on Arduino as shown below. When I run it from the main() it always works correctly (prints the message and gets into an infinite loop), however when I call it within ...
2 votes
1 answer
148 views

Debug-logging without using Serial.print and without WiFi

In order to transmit text from the Arduino board to the HC-05 Bluetooth module, I have use Serial.print. However, I don't see a way to debug the code without using Serial.print to test the other ...
0 votes
1 answer
873 views

Serial communication of strings

I used this simple code to understand the basics of serial communication. This achieves simple communication between the computer and arduino: String receive_buffer; void setup() { Serial.begin(9600)...
2 votes
0 answers
46 views

LED not lighting up despite digitalRead displaying 1

As part of a project, I created a simulation of a juncture with 4 traffic signals. The time for the green signal is set based on a function that calculates it based on an algorithm (and it takes the ...
0 votes
2 answers
88 views

Don't understand problem with my code

I'm trying to get a robot car(elegoo one) to do the obstacle avoidance course. I am trying to write my own one from scratch to better myself and thus would really appreciate it if someone were to tell ...
3 votes
1 answer
9k views

Help solving "collect2.exe: error: ld returned 1 exit status" error in code

I just got an Elegoo UNO starter kit the other day and have been working my way through the little tutorials on all the parts it came with. I am using VSCode with Platform.io plugin and (after getting ...
1 vote
1 answer
1k views

Onboard led HIGH and LOW seems reversed

On an ESP32 board I am trying this simple code to control the onboard led. But if I set it to HIGH, led is OFF, if I set it to LOW, led is ON (fully bright). What could cause this ? The board has one ...
0 votes
2 answers
842 views

Why I could not read the other sms's except the first SMS?

I have to read the incoming SMS on my GSM module SIM900, and I want to print the sender number and message to the serial monitor. I first configure the GSM module with AT commands and Response() ...
16 votes
6 answers
169k views

How do I resolve "avrdude: stk500_recv(): programmer is not responding"?

Whenever I try to program my Arduino UNO Rev.3, I'm seeing the following error avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00 ...
3 votes
3 answers
2k views

How compile an Arduino program for a desktop PC

I have an arduino program that only does serial communications with a little bit of math, and I am writing another one to communicate with it on a second arduino. For testing purposes I was hoping I ...
15 votes
4 answers
7k views

My code seems to be a train wreck

I am new to programming and I thought a simple project to do would be to create an ammo counter. I have been troubleshooting this code for several hours now, and can not figure out why my code is ...
1 vote
0 answers
753 views

Display GPS module data to my TFT display

I am using Arduino Mega 2560 and I have written code for my GPS module (Neo-6m-0-001/GY-NEO6MV2) and it is working fine independently. I also have written code for Compass module (QMC5883L) which is ...
1 vote
0 answers
70 views

Need debug Software that can be used with Arduino IDE

Background: I have made a standalone Arduino board using Atmega328PB. I have written code for a clock which lights LEDs based on the time. After a day or so it locks up. Sometimes it reboots. I ...
1 vote
1 answer
694 views

ESP - Nodemcu amica - attachInterrupt crash program

I get new boards from the shop but they are little different from the previous version. I got software what works ok on Nodemcu lolin v3 now I get Nodemcu Amica what is almost same board but if I got ...
1 vote
0 answers
229 views

Lilygo TTGO T-Beam Guru Meditation Error

I have recently purchased a lilygo ttgo t-beam (868Mhz version) on which I try to run the "DeviceInfo" example code provided by TheThingsNetwork. When executing ttn.ShowStatus(); I see in ...
-1 votes
1 answer
184 views

Serial.print array displays nothing

I tried Serial.print an array I had made, but the Arduino displays nothing in the monitor. I tried doing Serial.print("Hehehe"); as a test, but it just displayed "h?h?h?". The monitor works fine ...
1 vote
1 answer
151 views

Help with debugging code

This is NOT my code; was posted on Project Hub. I tried to use the code (humidity controller) but it returns an error on line 270: else if (DHT.humidity >= setpoint + 3 and syson == true) { //if ...
4 votes
1 answer
9k views

Does ATMega 328/2560 chips support JTAG-type programmer and hardware debugger?

As stated in www.Arduino.cc FAQ, "Can I use an Arduino board without the Arduino software? Sure. It's just an AVR development board, you can use straight AVR C or C++ (with avr-gcc and avrdude or AVR ...
1 vote
1 answer
277 views

How to fix error line number offset in Sublime Text when compiling for Arduino

When compiling for Arduino via the Stino plugin line numbers are not represented correctly in the output. For example, I have an error on line 117 however the output is: sketch_name.ino.cpp:136:1: ...
0 votes
2 answers
739 views

"expected primary-expression before '.' token" in debug code

I'm making some code for school, and is adding debug code to it. When compiling, I get the error as written in the title. This is the code in question: #define DEBUG 1 #ifdef DEBUG #define Serial....
0 votes
1 answer
309 views

How to debug Arduino using Atmel studio?

I have an Arduino Yun board and an Atmel ICE programmer/debugger. There are 6 pins on the Arduino Yun to connect to Atmel ICE for programming only, but I can't find the pins for debugging. Anyway to ...
2 votes
0 answers
223 views

Intermittent wifi/hotspot connection

I have an Arduino Mega 2560 with a cc3000 Wifi shield that is sending messages to dweet.io. Here is the relevant portion of my code: // Post data to dweetio char data[125]; sprintf(data, "?t1=...
2 votes
0 answers
103 views

Strange problem with serial communication

I'm developing a little project with Arduino, using a small web page to show data. Well, I have been develop the web page and the small code to communicate with Arduino board in my local computer and ...
1 vote
1 answer
88 views

Maximum Capacity Debugging

1. Example Check the program below for an Arduino Nano, Old Bootloader, for variable values of N. For low values (N<=1857), the program outputs "[FFFFFFFF]", For higher values (1858<=N<=...
1 vote
0 answers
793 views

Arduino IDE - debugging Exception 29

I installed the ESP EXCEPTION DECODER along with my Arduino IDE. When my sketch crashes with Exception 29, I take the stack trace and input it, but I can't understand its line references (they dont ...
2 votes
1 answer
49 views

From Exploring Arduino Text

I am working thru the Exploring Arduino text mostly with success up until chapter 4. I have most of the parts required but for Figure 4-3 I used the following: 100nF Capacitor, (In place of 1uF ...
0 votes
1 answer
75 views

Weird problem with arduino

I wrote the code below and the result is not what I expected at all! I'm not sure why it's happening! void setup() { // put your setup code here, to run once: Serial.begin(9600); } const uint8_t ...
3 votes
2 answers
3k views

How do I see underlying code and definitions inside Arduino IDE on MacOS X El Capitan

I'm a newbie to Arduino so please excuse the easy question and guide me to the appropriate sources or forums. I just bought an Arduino Uno Starter Kit that comes with the "Arduino Projects Book" by ...
2 votes
1 answer
2k views

Code will not run when Serial Monitor is not open

My code runs perfectly as long as the serial port is open. However if I connect it to external power, or even if I just try to run it plugged into my computer with the Serial Monitor not open, nothing ...
0 votes
2 answers
110 views

For loop broken? [closed]

This is a pseudo code from my LED cube project void loop(){ //switch( map(constrain(analogRead(pt),10,1020),10,1020,1,4)); - for select pattern //show(1); for(lp=128;lp>=1;lp = lp/2){ ...
5 votes
2 answers
6k views

How do I debug on-chip with Arduino?

Though an emulator is quite useful for debugging code that has no side effects, most real-world applications include some circuitry besides the Arduino. If a microcontroller on an Arduino had a JTAG ...
1 vote
3 answers
6k views

error: expected primary-expression before '(' token

I have a decent level of programming skill, or at least I thought so. I've been getting an error when compiling this Ardulno sketch. I don't really know what this error means or how to fix it. What's ...
1 vote
2 answers
474 views

How to programmatically choose "board model" and "port number" in Arduino IDE?

I'm testing three different Arduino (nano, Uno and Mega) each of them having a nRF module. The codes (sketches) are different for each module. I've connected the arduinos to my single laptop via 3 USB ...