Send a stepping value, from arduino to another

Hello

I am new in programing, and not a native English.

My plan is to build one strip feeder with stepper motor. I found out, that if I want to keep a stepping speed, its needing to have 1 UNO only for stepping, and use another to change a stepping value, and have LCD, with push buttons.
The code what I use is working well. In this code you need to type a “pos” value, and the UNO make stepping properly.
My problem is that I want to send the value of “pos” from another UNO. How can I do that?

#include <AccelStepper.h>

// Define a stepper and the pins it will use
AccelStepper stepper(AccelStepper::DRIVER, 9, 8);

#define  BUTTON  10
#define  LEDPIN  13

int pos = 3600;

void setup()
{  
  stepper.setMaxSpeed(6000);
  stepper.setAcceleration(10000);
  pinMode(BUTTON, INPUT_PULLUP);
  pinMode(LEDPIN, OUTPUT);
}

void loop()
{
  if (stepper.distanceToGo() == 0 && digitalRead(BUTTON) ==LOW)
  {
    
    stepper.move(pos);
  }

  if (stepper.distanceToGo() == 0)
  {
    digitalWrite(LEDPIN, HIGH);
  }
  
   else
    {
      digitalWrite(LEDPIN, LOW);
    }
  stepper.run();

}

Please someone to help me.
Thanks

Brinarpi:
My plan is to build one strip feeder with stepper motor. I found out, that if I want to keep a stepping speed, its needing to have 1 UNO only for stepping, and use another to change a stepping value, and have LCD, with push buttons.
The code what I use is working well. In this code you need to type a "pos" value, and the UNO make stepping properly.
My problem is that I want to send the value of "pos" from another UNO. How can I do that?

How many steps per second do you need?

I ask because if you are thinking of using 2 Arduinos because you are right at the limit for the AccelStepper library then the extra code to receive data may also be too much.

On the other hand, if the step rate is modest I suspect the reason you are thinking of using two Arduinos is because the other code (for the LCD etc) was poorly written.

The simplest way to send data between two Arduinos is using Serial - see Serial Input Basics or SPI. SPI has the advantage that it leaves Hardware Serial pins free for debugging but the programming for SPI may seem a little more complex for a beginner.

...R

To count a little. My stepper motor is 200 steps/rev. If I use 1/2 stepps it means 400 step/rev.
I need to turn cca 500 rpm the motor. So 500*400= 200.000/60.
If I good count this is the fact.

With acceleration the motor starts at a smaller stepping and reach the needed rpm. Without acceleration the motor was blocked at a start with a same delays values between. Thats why i choose the accelstepper.

Of course I searching an easyest way becouse of begginners.
Once I see some good solution maybe I understand how it works. Untill that, I am searching in dark.

A

The AccelStepper library is not good for high step rates because it uses floating point maths which is very slow on an Arduino (I can't remember what is its upper limit).

I wonder if you get any value from 1/2 steps at 500RPM?

I believe others have got high step rates using my Simple Stepper Code (the second, non blocking, example is best). It should not be too difficult to add some simple acceleration to it.

...R