Abdulrahman mahmoud
Published © GPL3+

Line Tracker 4WD Car Arduino

Let's Make line follwer or tracker 4wd car Arduino

IntermediateFull instructions provided2 hours127
Line Tracker 4WD Car Arduino

Things used in this project

Story

Read more

Schematics

i tried to get a schematics

.

Code

the code

Arduino
the coode
#define int1 9
#define int2 10
#define int3 11
#define int4 12
#define enA 8
#define enB 7
#define line A0
#define led 5



void setup(){
  pinMode(int1, OUTPUT);
  pinMode(int2, OUTPUT);
  pinMode(int3, OUTPUT);
  pinMode(int4, OUTPUT);
  pinMode(enA, OUTPUT);
  pinMode(enB, OUTPUT);
  pinMode(line, INPUT);
  pinMode(led, OUTPUT);
  digitalWrite(led, HIGH);
}
void loop(){
  int lineSensor = analogRead(line);
  if(lineSensor < 500){
    stop();
  }
  else{
   
    forward();
  }
}
void forward(){
  digitalWrite(int1, HIGH);
  digitalWrite(int2, LOW);
  digitalWrite(int3, HIGH);
  digitalWrite(int4, LOW);
  digitalWrite(enA, HIGH);
  digitalWrite(enB ,HIGH);


}
void stop(){
  digitalWrite(int1, LOW);
  digitalWrite(int2, LOW);
  digitalWrite(int3, LOW);
  digitalWrite(int4, LOW);
  digitalWrite(enA, LOW);
  digitalWrite(enB ,LOW);
  

}

Credits

Abdulrahman mahmoud

Abdulrahman mahmoud

2 projects • 0 followers
hi my name is abdulrahman or you can also say abdoz .i have learned python | Arduino | C++ . Also , iam still more thing about programming.

Comments