Send data from arduino to arduino

Hello!

Is there any way i can send data from arduino to arduino?
My goal is to send Number of steps from the sender to the receiver

the stepper motor is connected to the receiver and i want it to received the numbers of steps it should do from the sender.

the code im working on makes the stepper rotate slowly. Its working as I wanted but the only problem is that its slow… that why im thinking of putting another arduino only for the stepper

this is a part of the code that handles the stepper… RPM_MS (ms) is the wind speed im getting and by that makes the stepper move to a position according to the wind speed

degreeA saves previous steps it made
stepper.startRotate(degreeA[j]); make the stepper rotate according to the number of steps degreeA[j]
```
*void motorpos()
  {
move_pos();
unsigned wait_time_micros = stepper.nextAction();
if (wait_time_micros <= 0) {
        stepper.disable();
       
 
        RPM_MS();
    }
    if (wait_time_micros > 100){
            RPM_MS();
    }
}

void move_pos()
{
//stepper.rotate(-10000);

//pos=map(ms,0,12,0,18000);
 
if (ms>12){
  ms=12;
}

if ((ms/12)*16500 > 4500 || (ms/12)*16500 <= 0){
  pos = (ms/12)*16500;
} else {
  pos = 0;
}

if(pos-prevpos != 0){

degreeA[i] = pos-prevpos;

i++;
   
}

if (degreeA[j]!=0 && stepper.nextAction() == 0 ){
 
  stepper.startRotate(degreeA[j]);
 
  j++;

}

if (j == 19 && stepper.nextAction() == 0){
  memset(degreeA, 0, sizeof(degreeA));

//degreeA[0] = (char)0;
  j=0;
  i=0;

}

prevpos=pos;

}*
```
thank you!

first result on google

It is not hard to send data from one Arduino to another but you may not need a second Arduino. You have not posted ALL of your code so I cannot help.

If your code contains delay(...), this may be part of your problem.

There are other potential issues.

the code does not contain any delay functions..

heres the code

@OP

The following diagram shows various wired ways of exchanging data between two Arduinos. Make your choice.
multicom.png

Figure-1: Possible wired communication links for exchanging data between two Arduinos

multicom.png

Zorkwan:
heres the code

Seems you forgot it....

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.

The technique in the 3rd example will be the most reliable. It is what I use for Arduino to Arduino and Arduino to PC communication.

You can send data in a compatible format with code like this (or the equivalent in any other programming language)

Serial.print('<'); // start marker
Serial.print(value1);
Serial.print(','); // comma separator
Serial.print(value2);
Serial.println('>'); // end marker

…R

Sorry about the code..didnt upload

moparftw:
lcd - Sending a value from one arduino to another - Arduino Stack Exchange

first result on google

it dosent work.. i dont know why but the receiving end show only a number 10 or 0