How much mega limitation for send int value of pc

I want to send int value 4000 times per second with UDP protocol of pc to arduino, do can support mega this work?

What are you intending to do with the data on the Arduino ?

i want to high and low 16 output pins based on these values

Have you tried?
What was the result?

The serial interface at 115200 baud should be capable of about 11,000 bytes per second. And you should be able to run the serial interface at 500,000 baud.

...R

i try this and have not problem with it, mega support it! but i want to use raspberry pi for my project because arduino do not support multitrading!

mmhr:
i try this and have not problem with it, mega support it! but i want to use raspberry pi for my project because arduino do not support multitrading!

So why didn't you use a Pi in the first place ?

because arduino is very simple and very cheaper in my country!

When you say

arduino do not support multitrading!

I assume that you mean that the Arduino does not support multitasking.

What exactly is it that you are doing ?

i want to read int value of pc , if data was for example 1 then high output pin3 and after 10 ms delay low it and doing this work for other 15 pin and do nothing in other

if(value==1)
{
digitalWrite(ledPin1, HIGH);
delay(10);
digitalWrite(ledPin15, LOW);
}
.
.
.
elseif(value==15)
{ digitalWrite(ledPin15, HIGH);
delay(10);
digitalWrite(ledPin15, LOW);
}
else
{
//nothing
}

For goodness sake don't do it with multiple if statements. Get the value and use it as the index to an array of pin numbers. Furthermore, don't use delay() !

mmhr:
i try this and have not problem with it, mega support it! but i want to use raspberry pi for my project because arduino do not support multitrading!

I can't make sense of this.

Do you want to use the RPi in place of the Mega - in which case enquire on an RPi Forum
OR
Do you want to use thr RPi in place of your PC - in which case, what is stopping you?

...R

UKHeliBob:
For goodness sake don't do it with multiple if statements. Get the value and use it as the index to an array of pin numbers. Furthermore, don't use delay() !

you right but i must have 10 ms minimum for output pin.

Robin2:
I can't make sense of this.

Do you want to use the RPi in place of the Mega - in which case enquire on an RPi Forum
OR
Do you want to use thr RPi in place of your PC - in which case, what is stopping you?

...R

i wanted to read of pc with mega and if tht dont work for me replace mega and pc with RPi

you right but i must have 10 ms minimum for output pin.

You don't need to use delay() for that. During the delay() nothing else can happen but by using other methods you can create a 10 ms timing period during which the Arduino can be doing other things such as receiving more data.

mmhr:
i wanted to read of pc with mega and if tht dont work for me replace mega and pc with RPi

An RPI is just a PC in a small package.

If your problem is just replacing delay() with millis() have a look at Several Things at a Time

..R