My stepper motors from rs485 supported pan / tilt projem for ip camera.

#include <SoftwareSerial.h>
#include <AccelStepper.h>
#include <AFMotor.h>
#define SSerialRX        0  //Serial Receive pin
#define SSerialTX        1  //Serial Transmit pin
#define SSerialTxControl 0   //RS485 Direction control
#define RS485Transmit    HIGH   // not needed here, the servos attached to the arduino will not transmit any data to the Pelco-D controller
#define RS485Receive     HIGH


SoftwareSerial RS485Serial(SSerialRX, SSerialTX); // RX, TX

AF_Stepper motor1(48, 1);
AF_Stepper motor2(48, 2);

byte byteReceived[7];
int byteNumber = 0;
int byteSend;


void setup() {  
Serial.begin(9600);      // opens serial port, sets data rate to 38400 bps
  Serial.println("Arduino Serial Servo Control with Pelco D");
  Serial.println();
 
  pinMode(SSerialTxControl, OUTPUT);    
  digitalWrite(SSerialTxControl, RS485Receive);  // Init Transceiver   
  RS485Serial.begin(9600);  
  
  motor1.setSpeed(100);  // 10 rpm   
  motor2.setSpeed(100);  // 10 rpm   
 
}

void loop() {

if (RS485Serial.available() > 0)  
 {      byteReceived[byteNumber ++] = RS485Serial.read();     
       if ( byteReceived[0] != 0xFF ) {byteNumber = 0;}        }
    if ( byteNumber > 6 )            {            
            byteNumber = 0;                                   
      byte data = byteReceived[3];      
      Serial.println(data, HEX);     
      switch(data)        {
          //case 0x00 : break;
          case 0x02 : motor1.step(100, BACKWARD, INTERLEAVE); break; //sağ
          case 0x04 : motor1.step(100, FORWARD, INTERLEAVE);  break;   //sol
          case 0x10 : motor2.step(70, FORWARD, INTERLEAVE); break;//aşağı
          case 0x08 : motor2.step(70, BACKWARD, INTERLEAVE); break;//yukarı
          case 0x12 : motor1.step(100, BACKWARD, INTERLEAVE), motor2.step(70, FORWARD, INTERLEAVE); break;//ALT SAĞ çapraz
          case 0x14 : motor1.step(100, FORWARD, INTERLEAVE), motor2.step(70, FORWARD, INTERLEAVE); break;//ALT SOL çapraz
          case 0xA : motor1.step(100, BACKWARD, INTERLEAVE), motor2.step(70, BACKWARD, INTERLEAVE); break;//ÜST SAĞçapraz
          case 0xC : motor1.step(100, FORWARD, INTERLEAVE), motor2.step(70, BACKWARD, INTERLEAVE); break;//ÜST SOL çapraz
 }
        
      
  }
}

We got code. In code tags. Yeah.
We got a schematic. Yeah.

What we didn't get was a question. Was there supposed to be one?

I did not understand what you said.

bykz:
I did not understand what you said.

You posted a program in your Original Post.

Why?

Do you have a problem that you need help with?
If so what is the problem?

...R

You appear to be trying to do hardware serial (Serial) and software serial (RS485Serial) on the same set of pins. That will NOT work.

I checked it no problem. The system is running. I use

I ran the system. There is no trouble for now. I might share the scheme and maybe do what it needs.
Thank you.

bykz:
I ran the system. There is no trouble for now. I might share the scheme and maybe do what it needs.
Thank you.

Thank you for sharing.

However I don't believe your code will be useful to another Arduino newbie unless you also include an extensive project description, details of the hardware you are using and the connections to the Arduino. It would also be useful if you can include information about problems you encountered while you were developing your system and how you solved them.

...R

I have used 1 arduino uno, L293D motor driver, ttlrs485 serial converter card, 2 stepper motors, 1 5 volt, 1 12volt DC adapter, 1 etrovision 8180u rs485 supported IP Camera. You see it in the next picture. Ip camera to connect to the camera via the camera to pan tilt aim. Since I am using rx0 on arduino, remove this pin when installing pc or I get an error because you are using the same outputs. After installing the codes, connect the ttlrs485 converter. This is the case.

bykz:
I have used 1 arduino uno, L293D motor driver, ttlrs485 serial converter card, 2 stepper motors, 1 5 volt, 1 12volt DC adapter, 1 etrovision 8180u rs485 supported IP Camera. You see it in the next picture. Ip camera to connect to the camera via the camera to pan tilt aim. Since I am using rx0 on arduino, remove this pin when installing pc or I get an error because you are using the same outputs. After installing the codes, connect the ttlrs485 converter. This is the case.

I think it is Turkish, so I want to exchange information.

Okaliptus:
I think it is Turkish, so I want to exchange information.

buyur