Go Down

Topic: Sketches behaving differently when the SERIAL MONITOR is activie (Read 2927 times) previous topic - next topic


I am working on sketches and trying to find bugs/problems.

To help I put lines with Serial.print() to see what is going on.

Weirdly though if I have the machine plugged in, and run the sketch, it crashes.
However, SAME SKETCH, but no 'puta plugged in, it doesn't crash.

Well, ok, it does, but not at the same point that it did when the 'puta was plugged in monitoring.

So as an example the sketch just keeps rebooting if I have the computer plugged in.
If I unplug the machine it goes further but then hangs.

And no, Pins 0 and 1 are not being used.
(Well, not that I can see.)

Coding Badly



The sketch is uploaded and "runs".

Data is only sent from the Arduino to the PC.
Just simple prints either saying where it is or sending a bit of data so I know what is going on.

Coding Badly

When the board is not connected to the computer, how is it powered?


Fair question.

External SMPS.  12v 2A.

Something else which is throwing me alonng this line is this:

Say I have a "working sketch".

Somewhere in it I put a:
Serial.print("blah blah");

When I upload it, the sketch fails.

If I remove that line, it works.

I know it sounds weird, but that is the honest truth to what I see happening.
If there are other problems in there somewhere of which I know nothing, I can't declare them here.



I really hope not.

Just hoping is not good enough. You need this:


You need to comment out a few long strings in your code to run this code, if your code is already running out of SRAM. What you described is very much like SRAM is running out.
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter


Well, we could debate this all day.
Or you could post code.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

Go Up