Questions tagged [debugging]

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

Filter by
Sorted by
Tagged with
16 votes
6 answers
168k 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 ...
Evan Carroll's user avatar
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 ...
pvGuy's user avatar
  • 183
9 votes
4 answers
15k views

How to use breakpoints for debugging

Breakpoints are a great way to see how the compiler runs to your code. Now my question is, is there a possibility to use breakpoints when you debug your code?
H. Pauwelyn's user avatar
9 votes
1 answer
1k views

Overview of compiled code size

When I compile my code, the Arduino IDE returns the binary sketch size in byte. Is there a good way to find out (approximately) what function or what part of my code takes up how much memory in ...
fuenfundachtzig's user avatar
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 ...
polkovnikov.ph's user avatar
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 ...
EEd's user avatar
  • 894
4 votes
3 answers
257 views

why does function affect my ISR?

I am currently running this piece of code: main.ino #include "speed_profile.h" void setup() { // put your setup code here, to run once: output_pin_setup(); cli(); timer1_setup(); sei(); } ...
Lamda's user avatar
  • 141
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 ...
Jurc192's user avatar
  • 73
3 votes
1 answer
122 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 ...
rayank97's user avatar
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 ...
bob mcgrath's user avatar
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 ...
wileyrivers's user avatar
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 ...
Starter's user avatar
  • 153
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 ...
Dave's user avatar
  • 157
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 ...
satan 29's user avatar
  • 169
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 ...
Brethlosze's user avatar
2 votes
1 answer
1k views

Am I Running Out of RAM Or Not?

I'm attempting to drive 300 TM1803 RGB LEDs from an Arduino Uno using the FastLED library. My code works fine for 100 LEDs, but when I go to 150, the arrays that store LED values and my sensor data ...
ahalekelly's user avatar
2 votes
1 answer
763 views

What protocols and tools does Arduino Due use for flashing and debugging?

I am interested in writing a simple C program outside of the Arduino IDE and respective libraries, but deploying it directly to an Arduino Due (which uses a SAM3X8E ARM MCU). I am trying to figure out ...
smeeb's user avatar
  • 499
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 ...
Joel Spolsky's user avatar
2 votes
1 answer
1k views

Why is Arduino STINO upload function not working?

I'm using sublime text for editing and modifying my arduino libraries. Sublime text is pretty pretty, useful and embed a very powerfull plugin system. Someone created an Arduino plugin for it. The ...
CopperMaze's user avatar
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 ...
Kronimiciad's user avatar
2 votes
1 answer
146 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 ...
user avatar
2 votes
2 answers
484 views

VisualMicro Can't compile in debug ('Serial' was not declared in this scope) for attiny84a

I was working on a project build initialy from the Arduino IDE to program an attiny84a (without a bootloader) using the board from https://github.com/damellis/attiny I got an atmel-ice recently and I ...
0xCDCDCDCD's user avatar
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 ...
West2Seven's user avatar
2 votes
1 answer
3k views

Issue with adding a library: No such file or directory

I downloaded a Library called "Morse" which I got from the Arduino website: http://arduino.cc/en/Hacking/LibraryTutorial (all the way at the bottom of the page there is a link called Morse.zip) And ...
rsthegreat12's user avatar
2 votes
2 answers
101 views

Extract arduino collected data periodically

I'd like to extract data collected by a battery powered arduino for example once a day without stopping it and not using SD card. It's posible, when I want to extract the collected data, to connect a ...
user4502's user avatar
2 votes
0 answers
63 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 ...
Manisha Narayana Gowda's user avatar
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 ...
satan 29's user avatar
  • 169
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 ...
user26383's user avatar
2 votes
0 answers
3k views

Sim800L HTTP post request stop working after a while

I am desperate to get my SIM800L module (http://www.ebay.co.uk/itm/SIM800L-GPRS-GSM-Module-Board-Quadband-QUAD-BAND-Antenna-for-MCU-Arduino-/321992759287) sending POST requests for a long period of ...
Pauline Issard's user avatar
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 ...
Juan Antonio's user avatar
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=...
ericksonla's user avatar
1 vote
2 answers
13k views

How to read code from Arduino Uno to Arduino IDE? [duplicate]

we can upload a code into Arduino UNO from our computers, but how about reading code? Can we read and get C codes from compiled codes from Arduino hardwares? My second question is that will we read ...
Bay's user avatar
  • 305
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 ...
Thundercoal's user avatar
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 ...
adrianTNT's user avatar
  • 252
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 ...
dude8604's user avatar
1 vote
1 answer
1k views

`servo.attach()` paralyzing (one) motor on L298N

I have 2 DC motors (well, 4; but each pair is controlled by the same "signals") connected via a L298N, which is connected to the Arduino. In addition, I have a servo motor connected to the Arduino. ...
Fine Man's user avatar
  • 189
1 vote
2 answers
126 views

Logging without IDE

Is there a way to log events on Arduino when developing using C / AVR toolchain, and not the Arduino IDE? Working on Ubuntu.
vasily's user avatar
  • 133
1 vote
1 answer
666 views

Arduino hangs after 3-4 minutes on battery power, but not on USB

I have a simple sketch running on a BE Leonardo-compatible board. It reads input from a potentiometer, and outputs to two RGB LEDs which change colour over time - in a different pattern if certain ...
Tynam's user avatar
  • 113
1 vote
1 answer
122 views

Starting Off Low-Level Port Access

   I'm trying to teach myself some low[er] level code, but I just can't get it to work. I've tried OR-ing stuff in, AND-ing stuff in, and just straight up defining stuff, but it's not ...
nick5435's user avatar
1 vote
3 answers
5k views

Why does my wired button always read HIGH?

I have made a simple Arduino program that uses a potentiometer to dim a LED. This program also makes a second LED blink. Finally, I have added a button that controls a third LED; this part of my ...
SaraMaeBee's user avatar
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 ...
kwhunter's user avatar
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<=...
Brethlosze's user avatar
1 vote
1 answer
246 views

Controllino Debugging

Its a well known fact, that you can debug your arduino board with the help of an Atmel Ice. However, you might know the Controllino which is an arduino compatible device. It has an ATmega2560 on it. ...
Fuzzyma's user avatar
  • 113
1 vote
2 answers
473 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 ...
Zeta.Investigator's user avatar
1 vote
1 answer
106 views

'Non-Deterministic' memory usage on Arduino

I had a problem with a memory leak in my sketch and cornered it with MemoryFree.h. This works great and I was able to fix my leak. My sketch is not really static, but My var sizes are. I observed, ...
moestly's user avatar
  • 347
1 vote
1 answer
3k views

Debugging with ISP

I would like to connect the Atmega328p chip to my desktop, through the USB, so I can run teraterm or hyperterminal for debugging purposes. I have already ordered a USB to TTL serial cable but it won'...
user3475003's user avatar
1 vote
3 answers
91 views

Problems stopping an if loop, and starting it as well

I want my code to run my motor for a specific amount of time at a specific speed and then stop and not do anything else. I'm having trouble here, I think with my switch and the if loops running on ...
Team One's user avatar
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 ...
Fires_CZ's user avatar
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? #...
1manonearth's user avatar
1 vote
1 answer
1k views

Temperature sensor bugs

My project is based on a moving fan using DHT11 sensors. I have used 2 void loops and the IDE is showing an error "exit status 1 redefinition of 'void loop()'" One doubt: Can we use 2 void loops ...
Reshu Singh's user avatar