Getting data to Arduino from previous serial when usb cable unplug

i have data from serial.available with arduino uno usb cable pluged in my pc, but when i give arduino external power and there is not plugged in my pc, there is no data in my arduino. My question is how can i buffer data from my previous serial??

Is this a specific problem? The description you gave is rather vague.
If this is a problem with only this one sketch, it would be helpful if you post the code in the provided code brackets.
The Arduino should not be receiving visible serial data from a USB port unless it is downloading a sketch, or running a sketch designed to receive serial data.

My question is how can i buffer data from my previous serial??

You can't. Unplugging the serial cable resets the Arduino. You could store data in EEPROM before that happens. But, that is not "buffering serial data".

@SilentDemon555 : I'm sorry guys, i just don't know how i tell my problem but i mean like @pauLs, hehehehee

@pauls : i'm sorry if i wrong but this is that i mean sir, so it's called "store data in EEPROM" ??? would you want to tell me? i need this to save previous serial available. So when i unplug my arduino from PC, it will save / store data to EEPROM from previous serial.

EEPROM is a special type of memory that doesn't forget its contents when you remove the power. So you can store your data there, but it's slow, you can only write a limited number of times (~100,000) and only 1k in size.

All these things may or may not be an issue for your application of which we know almost nothing.

So you need to tell us more about the quantity of data to be stored, now often you need to store it, and if there are any speed restrictions, eg if you have to save 1000 bytes in 20uS before the power fails.


Rob