upload problem


In left picture.
Why the Serial command cause the upload error?

Using XBee and Arduino Mega

Why the Serial command cause the upload error?

Well the error message says that it has failed to write to the flash and the sketch that gave an error is longer. Therefore at a first guess I would say it is because you have a processor with a bad piece of flash in it and in the successfully uploaded sketch you have not reached that part of flash yet.

It is nothing to do with the command as such.