Why Serial.println() modify my data?

I have some raw byte data, I'm too lazy to convert them to Hex so I decided to just use println() directly on it

Turn out it modify that data after println() is called, I've test it several times and result are same, Those data are modified by that println() command

why is that?

You obviously don't know the difference between Serial.print and Serial.write

ieee488:
You obviously don't know the difference between Serial.print and Serial.write

I mean...

println() is corrupted my data on the RAM

If there is a problem, it must be in the code that you didn't show us.

Please post the code, a sample of the corrupted data and what you expect the data to be.

Ok, I figured it out, I'm such an idiot XD
I'm prepare the code for posting then I found this

Where it cause problem:
Serial.println((char *)getBuffer());

Function:
uint8_t *getBuffer()
{
encom_Buffer[15] = 0; <---------- It's used to be there for debugging and I forgot about it XD
return encom_Buffer;
}

Sorry for being a total idiot :stuck_out_tongue:

Porama6400:
I have some raw byte data, I'm too lazy to convert them to Hex so I decided to just use println() directly on it

Turn out it modify that data after println() is called, I've test it several times and result are same, Those data are modified by that println() command

why is that?

Debugging hint: look around the forum.
How many posts report that Serial.println is corrupting data?
Not many, right?

Clue: guess where the problem lies.