Controlling of a Pair of Gear Motor

Description

        In this project we are going to control the rotation of a pair of Gear motor using Arduino. Using arduino the gear motor is rotate in clockwise and anticlockwise directions for an interval of time. As per the program this process will be continued. I think this project is very helpful to make moving robots using gear motors. Okey guys now we can do this.

Components Required

 1. Arduino UNO        -1
 2. L298N Module  -1
 3. Gear Motors    -2
 4. Rubber Wheels   -2
 5. Jumper Wires      -1

Circuit Diagram




Program

void setup() 
{
  // put your setup code here, to run once:
  pinMode(4 , OUTPUT);
  pinMode(5 , OUTPUT);
 }

void loop() 
 {
    // put your main code here, to run repeatedly:
   digitalWrite(4 , HIGH);
   digitalWrite(5 , LOW);
   delay(7000);
  
   digitalWrite(4 , LOW);
   digitalWrite(5 , LOW);
   delay(3000);

   digitalWrite(5 , HIGH);
   digitalWrite(4, LOW);
   delay(7000);
     }