Why my XMotion Mini Sumo Robot does nothing when it sees the white line?

I am coding my mini sumo robot with XMotion Arduino Based onboard control card and the xmotion library.
I am using ML1 Line Sensors(x2 Left and Right) and JS40F Infrared Object Detection Sensors (x5).
(I would also love to know what the remember variable does in this code.)
Here is my code:

#include <xmotion.h>
//************************//
int LeftSensor = 1; // Opponent Sensors D1, D2, D4, A4, A5  
int LefttDiagonalSensor = 2;                               
int MiddleSensor = 4;                                       
int RightDiagonalSensor = A4;                               
int RightSensor = A5;                                       
//************************//
int LeftLineSensor = 0; // Line Sensors D0 & A1             
int RightLineSensor = A1;                                   
//************************//
int Remember=5; // Remember Variable (NOT PIN NUMBER!)      
//************************//
int led1 = 8; // User Led D8                                
//************************//                                
int switch1 = 5; // Dipswitches (D5, D6, D7)                    
int switch2 = 6;                                            
int switch3 = 7;                                            
//************************//
int start = 10; // Microstart Input D10 (Left Corner I/O shares with the Start button) 
//************************//
void setup() {
  xmotion.StopMotors(100);                     
  xmotion.ToggleLeds(100);                    
  pinMode(led1, OUTPUT);                       
  pinMode(LeftSensor, INPUT);                   
  pinMode(LefttDiagonalSensor, INPUT);          
  pinMode(MiddleSensor, INPUT);                  
  pinMode(RightDiagonalSensor, INPUT);          
  pinMode(RightSensor, INPUT);                   
  pinMode(RightLineSensor, INPUT);              
  pinMode(LeftLineSensor, INPUT);                 
  pinMode(switch1, INPUT);                     
  pinMode(switch2, INPUT);                       
  pinMode(switch3, INPUT);                          
  digitalWrite(switch1, HIGH);                     
  digitalWrite(switch2, HIGH);                      
  digitalWrite(switch3, HIGH);                       
  digitalWrite(LefttDiagonalSensor, HIGH);           
  digitalWrite(MiddleSensor, HIGH);                 
  digitalWrite(RightDiagonalSensor, HIGH);         
  Serial.begin(3600);                              

}
void NoSensorRead() {
  while (digitalRead(start) == 1)
{
    if (digitalRead(MiddleSensor) == 1) 
    {
      xmotion.Forward(100, 1); 
       Remember = 0;           
 
    } 
    else if (digitalRead(LeftSensor) == 1) 
    {
      xmotion.Left0(50, 1);        
       Remember = 2;               

    } 
    else if (digitalRead(RightSensor) == 1)   
    {
      xmotion.Right0(50, 1);           
       Remember = 1;                   
    }
    else if (digitalRead(LefttDiagonalSensor) == 1)         
    {
       xmotion.ArcTurn(10, 70, 1);                          
       Remember = 2;                                       
    }
    else if (digitalRead(RightDiagonalSensor) == 1)         
    {
       xmotion.ArcTurn(70, 10, 1);                       
       Remember = 1;                                       
    }

    else if (digitalRead(LeftLineSensor) == 0 && digitalRead(RightLineSensor) == 1) 
    {
        xmotion.Left0(50, 30); 
        xmotion.Forward(70, 10);
    }
    
    else if (digitalRead(RightLineSensor) == 0 && digitalRead(LeftLineSensor) == 1)  
    {
        xmotion.Right0(50, 30); 
        xmotion.Forward(70.10);
    }

    else if (digitalRead(RightLineSensor) == 0 && digitalRead(LeftLineSensor) == 0)
    {
       xmotion.Backward(80, 50); 
        xmotion.Left0(50, 80); 
    }
    
    if (Remember == 0)
    {
       xmotion.Forward(100,1);
       
    }
    if (Remember == 1)
    {
       xmotion.Right0(50, 1);
     
    }
    if (Remember == 2)
    {
       xmotion.Left0(50, 1);
    }
    
    else if (digitalRead(RightSensor) == 0 || digitalRead(RightDiagonalSensor) == 0 || digitalRead(MiddleSensor) == 0 || digitalRead(LefttDiagonalSensor) == 0 || digitalRead(LeftSensor) == 0) 
    {
      xmotion.Left0(70,5);

    }
  }
  while (digitalRead(start) == 0) 
  {
    xmotion.StopMotors(1);
  }
}

Thanks for using code tags, but please read the forum guide in the sticky post.

Do not cross post. Are you the same person as this?

No, i am not. There will be a minisumo competition in Turkey in 2 weeks so this could be anyone using the same robot as me.

I am coding my mini sumo robot with XMotion Arduino Based onboard control card and the xmotion library.
I am using ML1 Line Sensors(x2 Left and Right) and JS40F Infrared Object Detection Sensors (x5).
I would also love to know what the remember variable does in this code.
Here is my code:

#include <xmotion.h>
//************************//
int LeftSensor = 1; // Opponent Sensors D1, D2, D4, A4, A5  //sol sensörü 1. pinde
int LefttDiagonalSensor = 2;                                //sol çapraz sensör 2. pinde
int MiddleSensor = 4;                                       //orta sensör 4. pinde
int RightDiagonalSensor = A4;                               //sağ çapraz A4. sensöre
int RightSensor = A5;                                       // sağ sensör A5
//************************//
int LeftLineSensor = 0; // Line Sensors D0 & A1             //sol çizgi sensörü 0.
int RightLineSensor = A1;                                   //sağ çizgi semsörü A1
//************************//
int Remember=5; // Remember Variable (NOT PIN NUMBER!)      //hatırla 5.(değişken ,pin numarası değil)
//************************//
int led1 = 8; // User Led D8                                //led 1 8.
//************************//                                //***********dipswitchler****************//
int switch1 = 5; // Dipswitches (D5, D6, D7)                //şalter1 5.       
int switch2 = 6;                                            //şlater2 6.
int switch3 = 7;                                            //şalter3 7.pin
//************************//
int start = 10; // Microstart Input D10 (Left Corner I/O shares with the Start button) //başlatma 10.(Microstart Girişi D10 (Sol Köşe G/Ç, Başlat düğmesiyle paylaşır)
//************************//
void setup() {
  xmotion.StopMotors(100);                     //100ms iki motoru durdur
  xmotion.ToggleLeds(100);                     //100ms ledler yanar
  pinMode(led1, OUTPUT);                        //led1 çıktı gibi davranacak şekilde yapılandırır
  pinMode(LeftSensor, INPUT);                   //sol sensör girdi ""
  pinMode(LefttDiagonalSensor, INPUT);           //sol çapraz sensör girdi""
  pinMode(MiddleSensor, INPUT);                  //orta sensör girdi
  pinMode(RightDiagonalSensor, INPUT);          //sağ çapraz sensör girdi ""
  pinMode(RightSensor, INPUT);                   //sağ sensör girdi
  pinMode(RightLineSensor, INPUT);               //sağ çizgi sensörü girdi
  pinMode(LeftLineSensor, INPUT);                 //sol çizgi sensörü girdi ""
  pinMode(switch1, INPUT);                     //şalter1 girdi""
  pinMode(switch2, INPUT);                       //şalter2 girdi ""
  pinMode(switch3, INPUT);                          //şalter3 girdi ""
  digitalWrite(switch1, HIGH);                     //Pin, pinMode() ile bir ÇIKIŞ olarak yapılandırılmışsa, voltajı  YÜKSEK için 5V , DÜŞÜK için 0V Pin bir GİRİŞ olarak yapılandırılırsa, digitalWrite() giriş pinindeki dahili çekmeyi etkinleştirir (YÜKSEK) veya devre dışı bırakır (DÜŞÜK).
  digitalWrite(switch2, HIGH);                      //şalter2 yüksek voltaj
  digitalWrite(switch3, HIGH);                       //şalter3 yüksek voltaj
  digitalWrite(LefttDiagonalSensor, HIGH);           //sol öapraz sensörü yüksek voltaj
  digitalWrite(MiddleSensor, HIGH);                 //orta sensör yüksek voltaj
  digitalWrite(RightDiagonalSensor, HIGH);          //sağ çapraz sensör yüksek voltaj
  Serial.begin(3600);                              //Seri veri iletimi için veri hızını saniyede bit (baud) olarak ayarlar. (hız 3600)

}
void NoSensorRead() {
  while (digitalRead(start) == 1) // başlangıçtaki gerilim yüksekken (doğru)
{
    if (digitalRead(MiddleSensor) == 1) // orta sensör karşısında rakip var ise
    {
      xmotion.Forward(100, 1); //iki motor %100 hızda 1ms
       Remember = 0;           //remember değişkeni 0
 
    } 
    else if (digitalRead(LeftSensor) == 1) //değilse ve sol sensör rakip görüyorsa
    {
      xmotion.Left0(50, 1);         //%50 hızda 1ms sola tank dönüşü
       Remember = 2;                // remember değişkeni 2

    } 
    else if (digitalRead(RightSensor) == 1)   //değilse ve sağ sensör rakip görüyorsa
    {
      xmotion.Right0(50, 1);            //%50 hızda 1ms tank dönüş
       Remember = 1;                    //remember değişkeni 1
    }
    else if (digitalRead(LefttDiagonalSensor) == 1)         //değilse ve sol çapraz sensörü rakip algıladıysa 
    {
       xmotion.ArcTurn(10, 70, 1);                          //1ms sol motor %10 hızda sağ %70 hızda kavisli dönüş
       Remember = 2;                                        //remember değişkeni 2 
    }
    else if (digitalRead(RightDiagonalSensor) == 1)         //değilse ve eğer sağ çapraz sensör rakip algıladıysa
    {
       xmotion.ArcTurn(70, 10, 1);                         //1ms %70 sol motor %10 sağ kavisli dönüş
       Remember = 1;                                       //remember değişkeni 2 yap
    }

    else if (digitalRead(LeftLineSensor) == 0 && digitalRead(RightLineSensor) == 1) // sol çizgi sensörü bişi görmüyosa ve sağ çizgi sensörü görüyorsa
    {
        xmotion.Left0(50, 30); // %50 hızla sağa tank dönüşü 0ms
        xmotion.Forward(70, 10);
    }
    
    else if (digitalRead(RightLineSensor) == 0 && digitalRead(LeftLineSensor) == 1) // sağ çizgi sensörü bişi gördüğünde
    {
       xmotion.Backward(80, 20); // %80 geriye 20ms
        xmotion.Left0(50, 30); // %50 sol tank dönüşü 30ms
    }

    else if (digitalRead(RightLineSensor) == 0 && digitalRead(LeftLineSensor) == 0) // iki sensör de çizgiyi gördüğünde
    {
       xmotion.Backward(80, 50); // %80 geriye 50ms.
        xmotion.Left0(50, 80); // %50 sola tank dönüşü 80ms.
    }
    
    if (Remember == 0)
    {
       xmotion.Forward(100,1);
       
    }
    if (Remember == 1)
    {
       xmotion.Right0(50, 1);
     
    }
    if (Remember == 2)
    {
       xmotion.Left0(50, 1);
    }
    
    else if (digitalRead(RightSensor) == 0 || digitalRead(RightDiagonalSensor) == 0 || digitalRead(MiddleSensor) == 0 || digitalRead(LefttDiagonalSensor) == 0 || digitalRead(LeftSensor) == 0) //hiçbişi görmüyosa motorları durdur
    {
      xmotion.Left0(70,5);

    }
  }
  while (digitalRead(start) == 0) 
  {
    xmotion.StopMotors(1);
  }
}

See this post

What model Arduino are you using? On an UNO/Nano/MEGA/Leonardo... you can't use Pin 0 for both data I/O and Serial.

Your two topics on the same or similar subject have been merged.

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Repeated duplicate posting could result in a temporary or permanent ban from the forum.

Could you take a few moments to Learn How To Use The Forum

It will help you get the best out of the forum in the future.

  • Your OS and version can be valuable information, please include it along with extra security you are using.

  • Always list the version of the IDE you are using and the board version if applicable.

  • Use quote or add error messages as an attachment NOT a picture.

  • How to insert an image into your post. ( Thanks @sterretje )

  • Add your sketch where applicable but please use CODE TAGS ( </> )

  • Add a SCHEMATIC were needed even if it is hand drawn

  • Add working links to any specific hardware as needed (NOT links to similar items)

  • Remember that the people trying to help cannot see your problem so give as much information as you can

COMMON ISSUES

  • Ensure you have FULLY inserted the USB cables.

  • Check you have a COMMON GROUND where required. ( Thanks @Perry)

  • Where possible use USB 2.0 ports or a USB 2.0 POWERED HUB to rule out USB 3.0 issues.

  • Try other computers where possible.

  • Try other USB leads where possible.

  • You may not have the correct driver installed. CH340/341 or CP2102 or FT232 VCP Drivers - FTDI

  • There may be a problem with the board check or remove your wiring first.

  • Remove any items connected to pins 0 and 1.

COMPUTER RELATED

  • Close any other serial programs before opening the IDE.

  • Ensure you turn off any additional security / antivirus just to test.

  • There may be a problem with the PC try RESTARTING it.

  • You may be selecting the wrong COM port.

  • Avoid cloud/network based installations where possible OR ensure your Network/Cloud software is RUNNING.

  • Clear your browsers CACHE.

  • Close the IDE before using any other serial programs.

  • Preferably install IDE’s as ADMINISTRATOR or your OS equivalent

ARDUINO SPECIFIC BOARDS

  • CH340/341 based clones do not report useful information to the “get board info” button.

  • NANO (Old Types) some require you to use the OLD BOOTLOADER option.

  • NANO (ALL Types) See the specific sections lower in the forum.

  • NANO (NEW Types) Install your board CORE’s.

  • Unless using EXTERNAL PROGRAMMERS please leave the IDE selection at default “AVRISP mkII”.

  • Boards using a MICRO usb connector need a cable that is both DATA and CHARGE. Many are CHARGE ONLY.

CREATE editor install locations.

  • On macOs ~/Applications/ArduinoCreateAgent-1.1/ArduinoCreateAgent.app/Contents/MacOS/config.ini

  • On Linux ~/ArduinoCreateAgent-1.1/config.ini

  • On Windows C:\Users[your user]\AppData\Roaming\ArduinoCreateAgent-1.1

Performing the above actions may help resolve your problem without further help.

Language problem ?

Try a language closer to your native language:

Thanks to all those who helped and added to this list.

We are not using an Arduino card, we are using the XMotion's arduino based control card which can be coded by arduino app.

It acts like an Arduino Leonardo and you should mention the "Arduino Leonardo" next time you seek help with programming it.

I can't try your sketch because it does not have the required "loop()" function.