Go Down

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

lost_and_confused

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


lost_and_confused

No,

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?

lost_and_confused

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.



liudr


I really hope not.




Just hoping is not good enough. You need this:

http://www.arduino.cc/playground/Code/AvailableMemory

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.

AWOL

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.

Go Up