SD Read & Write with Modbus slave

//RS-485 Modbus Slave (Arduino UNO)
//Circuit OZOX

#include<ModbusRtu.h>       //Library for using Modbus in Arduino
#include <Servo.h>          //Library for using Servo Motor
#include <SD.h>             //Library for using SD Card
#include <SPI.h>            //Library for using SPI IO

#define led1 2              //Define as 2 led1 
#define led2 5              //Define as 5 led2
#define led3 7              //Define as 7 led3 
#define led4 8              //Define as 8 led4 
#define but 3               //Define as 3 but as Button 

#define CS_PIN 9            //Define as 9 CS pin for SPI

File myFile;

Servo servo;                         //Initilize servo object for class Servo
Modbus bus;                          //Define Object bus for class modbus 
uint16_t modbus_array[10];           //Array initilized
const int chipSelect = 10;
int btnSta = 0;
int myFi[10];
String s = " ";
String myf[10];
  
void setup()
{
  pinMode(led1,OUTPUT);           //Led1 set as OUTPUT
  pinMode(led2,OUTPUT);           //Led2 set as OUTPUT
  pinMode(led3,OUTPUT);           //Led2 set as OUTPUT
  pinMode(led4,OUTPUT);           //Led2 set as OUTPUT
  pinMode(9, OUTPUT);
  pinMode(3, INPUT);
  
  SD.begin(CS_PIN);
  Serial.begin(9600);

  myFile = SD.open("test.txt", FILE_READ);
  if(myFile)
  {
    for(int i=0;i<10;i++)
    {
    myFi[i]=myFile.parseInt();
    modbus_array[i] = myFi[i];
    } 
   myFile.close();
  }
  else{
    for(int i=0;i<10;i++)
    {
    modbus_array[i] = 0x00;
    }
    Serial.print("File didnt open...");
    delay(20);
  }
  
  servo.attach(6);                //Servo PWM pin 6
  bus = Modbus(1,1,4);            //Modbus slave ID as 1 and 1 connected via RS-485 and 4 connected to DE & RE pin of RS-485 Module 
  bus.begin(9600);                //Modbus slave baudrate at 9600
}

void loop()
{
   bus.poll(modbus_array,sizeof(modbus_array)/sizeof(modbus_array[0]));       //Used to receive or write value from Master 
  
  if (modbus_array[0] == 0)
  {
    digitalWrite(led1,LOW);
  }
  else
  {
     digitalWrite(led1,HIGH);
  } 

 if (modbus_array[1] == 0)
  {
    digitalWrite(led2,LOW);
  }
  else
  {
     digitalWrite(led2,HIGH);
  }
   if (modbus_array[2] == 0)
  {
    digitalWrite(led3,LOW);
  }
  else
  {
     digitalWrite(led3,HIGH);
  }
   if (modbus_array[3] == 0)
  {
    digitalWrite(led4,LOW);
  }
  else
  {
     digitalWrite(led4,HIGH);
  }
  int pwm = modbus_array[4];
  servo.write(pwm);
  
  btnSta = digitalRead(but);
  if(btnSta==LOW)
  {
  }
  else
  {
      SD.remove("test.txt");
      delay(10);
      write_(myFile);
      //oku(myFile)); // Eğer dosyayı okumak isterseniz.
  }
  delay(250);
  }

  void write_(File ff)
  {
    String dd="";
       ff = SD.open("test.txt", FILE_WRITE);
       if(ff)
       {
    for(int i=0;i<10;i++)
    {
    myFi[i] = (int)modbus_array[i];
    dd += myFi[i] + s;
    }
    ff.print(dd);
    ff.close();
     Serial.print("Yazılan değerler: " + dd);
       }
       else
       {
        Serial.print("File didnt open..");
        delay(20);
       }
  }

    void read_(File ff)
  {
    String gg="";
    ff = SD.open("test.txt", FILE_READ);
    if(ff)
    {
    for(int i=0;i<10;i++)
    {
    myFi[i] = ff.parseInt();
    }
    for(int i=0;i<10;i++)
    {
      gg += myFi[i] + s;
    }
    ff.close();
    Serial.print("Okunan değerler: " + gg);
    }
    else
    {
        Serial.print("File didnt open..");
        delay(20);
    }
  }

So… what’s the problem ?
What doesn’t your program do ?
Where’s the power coming from ?