user53266: I set up this circuit which uses L293D motor driver IC to control two DC motors.

+6V input is connected to unregulated power supply. It's current rating is 500 mA.
There is a connection between Arduino's ground line and power supplies ground line. There is a parallel 0.1 uF capacitor connected between motor terminal pins.
There is a wheel at the end of the motors but they don't have a gearbox. The wheels are suspended so that they can rotate freely.
The source code of the software is as follows.
#include <Arduino.h>

unsigned int firstMotorPositive = 8;
unsigned int firstMotorNegative = 7;
unsigned int enableFirstMotor = 9;
unsigned int secondMotorPositive = 5;
unsigned int secondMotorNegative = 4;
unsigned int enableSecondMotor = 3;

void setup()
{
    pinMode(firstMotorPositive, OUTPUT);
    /*  I've changed this part as shown by @timemage  */
    //pinMode(secondMotorPositive, OUTPUT); // <------
    pinMode(firstMotorNegative, OUTPUT);
    pinMode(enableFirstMotor, OUTPUT);
    pinMode(secondMotorPositive, OUTPUT);
    pinMode(secondMotorNegative, OUTPUT);
    pinMode(enableSecondMotor, OUTPUT);

    // All motors are off
    digitalWrite(firstMotorPositive, LOW);
    digitalWrite(firstMotorNegative, LOW);
    digitalWrite(secondMotorPositive, LOW);
    digitalWrite(secondMotorNegative, LOW);
}

void turnOnMotors()
{
    // Set motors to maximum speed
    // For PWM maximum possible values are 0 to 255
    analogWrite(enableFirstMotor, 255);
    analogWrite(enableSecondMotor, 255);


    // Turn on motor A & B
    digitalWrite(firstMotorPositive, HIGH);
    digitalWrite(firstMotorNegative, LOW);
    digitalWrite(secondMotorPositive, HIGH);
    digitalWrite(secondMotorNegative, LOW);
    delay(2000);

    // Turn off motors
    digitalWrite(firstMotorPositive, LOW);
    digitalWrite(firstMotorNegative, LOW);
    digitalWrite(secondMotorPositive, LOW);
    digitalWrite(secondMotorNegative, LOW);

    analogWrite(enableFirstMotor, 0);
    analogWrite(enableSecondMotor, 0);

}

void speedControl()
{
    digitalWrite(firstMotorPositive, HIGH);
    digitalWrite(firstMotorNegative, LOW);
    digitalWrite(secondMotorPositive, HIGH);
    digitalWrite(secondMotorNegative, LOW);


    analogWrite(enableFirstMotor, 63);
    analogWrite(enableSecondMotor, 63);

    delay(3000);

    analogWrite(enableFirstMotor, 127);
    analogWrite(enableSecondMotor, 127);
    delay(3000);

    analogWrite(enableFirstMotor, 191);
    analogWrite(enableSecondMotor, 191);
    delay(3000);
/*
    analogWrite(enableFirstMotor, 255);
    analogWrite(enableSecondMotor, 255);
    delay(3000);
*/


    // All motors are off
    digitalWrite(firstMotorPositive, LOW);
    digitalWrite(firstMotorNegative, LOW);
    digitalWrite(secondMotorPositive, LOW);
    digitalWrite(secondMotorNegative, LOW);
    analogWrite(enableFirstMotor, 0);
    analogWrite(enableSecondMotor, 0);
}

void loop()
{

    /*
      turnOnMotors();
      delay(1000);
    */

    speedControl();
    delay(1000);
}

The problem is they need help to start rotating. They will only start rotating if I physically twist the shaft with my fingers first.
As far as I know the motors used in this circuit are two 6 volt DC motors.
When I measure the maximum voltage between motor terminals I read about 0.5 volts. If I twist the shaft I read about 4.5 volts.

user4143: The L2978D is a terrible motor driver (I really wish people wouldn't use it!). It is "bipolar" which means that both the high and low side switches of the H-bridge are Bipolar Junction Transistors. This means that you get about 1.4V voltage drop in total between the inputs and outputs.
To counter that you must provide at least 1.4V more than your motors need for them to operate properly.

user70020: no pinMode(firstMotorNegative, OUTPUT)
Well, here's a start at least:
pinMode(firstMotorPositive, OUTPUT);
pinMode(secondMotorPositive, OUTPUT); // <------
pinMode(enableFirstMotor, OUTPUT);
pinMode(secondMotorPositive, OUTPUT);
pinMode(secondMotorNegative, OUTPUT);
pinMode(enableSecondMotor, OUTPUT);

You are never setting firstMotorNegative to OUTPUT and probably intended to on the second line of this excerpt.
firstMotorNegative floating or pulled high
The AVR GPIO pins are INPUT on power-up.  Writing to the PORT register, which is what digitalWrite does, takes on a different meaning when the pin's mode is INPUT.  That is, it enables or disables the pull-up internal resistors.  In other words, your     digitalWrite(firstMotorNegative, HIGH); and digitalWrite(firstMotorNegative, LOW); are effectively toggling between pinMode(firstMotorNegative, INPUT_PULLUP) and  pinMode(firstMotorNegative, INPUT) respectively.
So your L293D is seeing either this signal being weakly pulled up or floating.  During the floating condition in particular maybe a problem when you're doing:
// Turn on motor A & B
digitalWrite(firstMotorPositive, HIGH);
digitalWrite(firstMotorNegative, LOW);

... because you're disabling the pull-up here, the "negative" pin is INPUT/floating rather than reliably LOW.  So, it may be being intermittently interpreted as HIGH at the L293D, in which case there is no movement while that's happening.

53266: <p>I set up this circuit which uses L293D motor driver IC to control two DC motors.</p>
<p><a href="https://i.stack.imgur.com/nATI3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nATI3.png" alt="LM298D motor driver" /></a></p>
<p>+6V input is connected to unregulated power supply. It's current rating is 500 mA.</p>
<p>There is a connection between Arduino's ground line and power supplies ground line. There is a parallel 0.1 uF capacitor connected between motor terminal pins.</p>
<p>There is a wheel at the end of the motors but they don't have a gearbox. The wheels are suspended so that they can rotate freely.</p>
<p>The source code of the software is as follows.</p>
<pre><code>#include &lt;Arduino.h&gt;

unsigned int firstMotorPositive = 8;
unsigned int firstMotorNegative = 7;
unsigned int enableFirstMotor = 9;
unsigned int secondMotorPositive = 5;
unsigned int secondMotorNegative = 4;
unsigned int enableSecondMotor = 3;

void setup()
{
    pinMode(firstMotorPositive, OUTPUT);
    /*  I've changed this part as shown by @timemage  */
    //pinMode(secondMotorPositive, OUTPUT); // &lt;------
    pinMode(firstMotorNegative, OUTPUT);
    pinMode(enableFirstMotor, OUTPUT);
    pinMode(secondMotorPositive, OUTPUT);
    pinMode(secondMotorNegative, OUTPUT);
    pinMode(enableSecondMotor, OUTPUT);

    // All motors are off
    digitalWrite(firstMotorPositive, LOW);
    digitalWrite(firstMotorNegative, LOW);
    digitalWrite(secondMotorPositive, LOW);
    digitalWrite(secondMotorNegative, LOW);
}

void turnOnMotors()
{
    // Set motors to maximum speed
    // For PWM maximum possible values are 0 to 255
    analogWrite(enableFirstMotor, 255);
    analogWrite(enableSecondMotor, 255);


    // Turn on motor A &amp; B
    digitalWrite(firstMotorPositive, HIGH);
    digitalWrite(firstMotorNegative, LOW);
    digitalWrite(secondMotorPositive, HIGH);
    digitalWrite(secondMotorNegative, LOW);
    delay(2000);

    // Turn off motors
    digitalWrite(firstMotorPositive, LOW);
    digitalWrite(firstMotorNegative, LOW);
    digitalWrite(secondMotorPositive, LOW);
    digitalWrite(secondMotorNegative, LOW);

    analogWrite(enableFirstMotor, 0);
    analogWrite(enableSecondMotor, 0);

}

void speedControl()
{
    digitalWrite(firstMotorPositive, HIGH);
    digitalWrite(firstMotorNegative, LOW);
    digitalWrite(secondMotorPositive, HIGH);
    digitalWrite(secondMotorNegative, LOW);


    analogWrite(enableFirstMotor, 63);
    analogWrite(enableSecondMotor, 63);

    delay(3000);

    analogWrite(enableFirstMotor, 127);
    analogWrite(enableSecondMotor, 127);
    delay(3000);

    analogWrite(enableFirstMotor, 191);
    analogWrite(enableSecondMotor, 191);
    delay(3000);
/*
    analogWrite(enableFirstMotor, 255);
    analogWrite(enableSecondMotor, 255);
    delay(3000);
*/


    // All motors are off
    digitalWrite(firstMotorPositive, LOW);
    digitalWrite(firstMotorNegative, LOW);
    digitalWrite(secondMotorPositive, LOW);
    digitalWrite(secondMotorNegative, LOW);
    analogWrite(enableFirstMotor, 0);
    analogWrite(enableSecondMotor, 0);
}

void loop()
{

    /*
      turnOnMotors();
      delay(1000);
    */

    speedControl();
    delay(1000);
}
</code></pre>
<p>The problem is they need help to start rotating. They will only start rotating if I physically twist the shaft with my fingers first.</p>
<p>As far as I know the motors used in this circuit are two 6 volt DC motors.</p>
<p>When I measure the maximum voltage between motor terminals I read about 0.5 volts. If I twist the shaft I read about 4.5 volts.</p>
 4143: <p>The L2978D is a terrible motor driver (I really wish people wouldn't use it!). It is &quot;bipolar&quot; which means that both the high and low side switches of the H-bridge are Bipolar Junction Transistors. This means that you get about 1.4V voltage drop in total between the inputs and outputs.</p>
<p>To counter that you must provide at least 1.4V more than your motors need for them to operate properly.</p>
 70020: <h2>no pinMode(firstMotorNegative, OUTPUT)</h2>
<p>Well, here's a start at least:</p>
<pre><code>pinMode(firstMotorPositive, OUTPUT);
pinMode(secondMotorPositive, OUTPUT); // &lt;------
pinMode(enableFirstMotor, OUTPUT);
pinMode(secondMotorPositive, OUTPUT);
pinMode(secondMotorNegative, OUTPUT);
pinMode(enableSecondMotor, OUTPUT);
</code></pre>
<p>You are never setting <code>firstMotorNegative</code> to <code>OUTPUT</code> and probably intended to on the second line of this excerpt.</p>
<h2>firstMotorNegative floating or pulled high</h2>
<p>The AVR GPIO pins are <code>INPUT</code> on power-up.  Writing to the PORT register, which is what <code>digitalWrite</code> does, takes on a different meaning when the pin's mode is <code>INPUT</code>.  That is, it enables or disables the pull-up internal resistors.  In other words, your     <code>digitalWrite(firstMotorNegative, HIGH);</code> and <code>digitalWrite(firstMotorNegative, LOW);</code> are effectively toggling between <code>pinMode(firstMotorNegative, INPUT_PULLUP)</code> and  <code>pinMode(firstMotorNegative, INPUT)</code> respectively.</p>
<p>So your L293D is seeing either this signal being weakly pulled up or floating.  During the floating condition in particular maybe a problem when you're doing:</p>
<pre><code>// Turn on motor A &amp; B
digitalWrite(firstMotorPositive, HIGH);
digitalWrite(firstMotorNegative, LOW);
</code></pre>
<p>... because you're disabling the pull-up here, the &quot;negative&quot; pin is <code>INPUT</code>/floating rather than reliably <code>LOW</code>.  So, it may be being intermittently interpreted as <code>HIGH</code> at the L293D, in which case there is no movement while that's happening.</p>
