I Can't Power a Motor Using a L293D, Is My Code the Problem?

Hello, first time arduino user here(probably relevant)

The board I use is Arduino Uno R3(probably not important)

I set up a L293d motor control circuit thing on a breadboard, i think i got the connections right. It worked a few times. It was stuck in a loop when it worked, on for like 10 seconds(there was only 2500 ms delay in code tho) off for some time and repeat. While I was pressing the reset button it didn't work but when I released the button it worked again.

I want to control the motor so constant loop is no good. Since I have seen the circuit is working, I think the problem with me being unable to control the motor is my code. Basically I want to have two kinds of Input for two directions motor can rotate. I tried to use serial monitor, it kinda works. When I input 0 or 1 i get no answer and when I input anything else it gives me an error message which is intended.

If you aren't familiar with l293d, relevant info here is i need to have a constantly 5v output to enable the circuit and two outputs working like an XOR . While XOR is 1 motor works.

Anyways, here is the code, I didn't comment it but it is easy to follow;

int motorPin1 = 9;
int motorPin2 = 10;
int logicPin = 8;

void setup() {
  Serial.begin(9600);
  pinMode(motorPin1, OUTPUT);
  pinMode(motorPin2, OUTPUT);
  pinMode(logicPin, OUTPUT);
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, LOW);
  digitalWrite(logicPin, HIGH);
}

void loop() { 
  if(Serial.available() > 0)
  {
    int SerialInput = Serial.parseInt();
    switch (SerialInput)
    {
      default:
        Serial.println("Error!");
        break;
      case 0:
        digitalWrite(motorPin1, HIGH);
        digitalWrite(motorPin2, LOW);
        delay(1000);
        digitalWrite(motorPin1, LOW);
        delay(1000);
        break;
      case 1:
        digitalWrite(motorPin1, LOW);
        digitalWrite(motorPin2, HIGH);
        delay(1000);
        digitalWrite(motorPin2, LOW);
        delay(1000);
        break;
    }
  }  
}

The L293D is rather limited and can handle only low power motors. What is the stall current of the motor and what is the voltage of the motor power supply?

Be sure not to use the Arduino for power. Connect the motor power supply ground to the Arduino ground.

jremington:
The L293D is rather limited and can handle only low power motors. What is the stall current of the motor and what is the voltage of the motor power supply?

Be sure not to use the Arduino for power. Connect the motor power supply ground to the Arduino ground.

I couldn't find what the stall current is.
I use 4 1,5V AA batteries as external power to power the motor. Directly it can power the motor, I have seen whole setup with l293d, arduino and stuff work as I mentioned. I think I just can't get the pin outputs to work properly.