Problem with serial communication!

Hi guys!!
I' ve a problem with serial communication from Arduino to Processing, i explain: If i want to send an int from to arduinio to processing i have no problem, but if i load a vector with random number and i want to send them to Processing, the Processing doesn' t show me the values. So i try to load a vector and i do some print on the serial monitor of the Arduino, but also in this case there is a problem, the monitror doesn' t show me the values. Why???
Arduino code:

int V[1024];
void setup()
{ Serial.begin(9600);
//Serial.flush();
}

void loop()
{
for(int i=0;i<1024;i++)
{
V*=random(100);*
_ Serial.write(V*);_
_
}_
_
}_
Processing code:
_mport processing.serial.;_

Serial myPort;
*int val; *
void setup()
{
* String portName = Serial.list()[1];*
* myPort = new Serial(this, portName, 9600);*
* println(portName);*
}
void loop()
{
* while ( myPort.available() > 0)*
* { val = myPort.read(); *
* println(val);*
* }*
}
Thanks for the answers!!

Which processor are you using?
That 1024 int vector looks suspisious

Processing 1.1...
Why the vector looks suspisious??
1024, 10 or 100...it's the same problem...I try...in your opinion, what is the problem??

Does it do anything different if you use Serial.print, instead of Serial.write?

Why the vector looks suspisious??

Sorry about the short reply (and my spelling), I was posting from my phone.

Well, a 168-based Arduino has 1kbyte of SRAM, which is only sufficient for at most an "int" vector of 512 elements, and a 328-based Arduino has only 2kbytes of SRAM which is sufficient for at most an "int" vector of 1024 elements.
However, these are the maximum sizes, but you're using memory for other stuff, like serial buffers and variables, and stack.

So, I'm assuming you're using a Mega, which has 8k byte of SRAM, big enough for all these things and a 1024 element "int" array.

But you didn't say what processor you're using.

I' m using an Atmega 168....so the max size of an int vector is 512 (in theory)...but my program is more complex an i try 512, after 256 but it doesn' t work. So i try with 128 and it works...(i' m stupid ;D)
Thanks!!!!! :wink:

Is there some reason to store the values in an array? If that was your complete sketch, the answer is no.

If that was an extract to illustrate a problem, then maybe. Although storing random values seems strange.