justsid28
Published

Arduino Car

In this project I will show you how I made a car. I will also show u how to make it step by step.

BeginnerShowcase (no instructions)2,654
Arduino Car

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
DC Motor, 12 V
DC Motor, 12 V
×4
8 Slots AA Battery Holder
×2
4WD Robot Motor Smart Car Chassis Kits
×1
L298N Stepper Motor Driver
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Multitool, Screwdriver
Multitool, Screwdriver

Story

Read more

Code

Code for motors

Arduino
//MOTOR1 PINS
int in1 = 6; //making all the pin integers
int in2 = 7;
int in3 = 10;
int in4 = 11;

void setup() {

  pinMode(in1, OUTPUT); //Setting all the pins as outputs
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);

digitalWrite(in1, HIGH); //Making car go straight
digitalWrite(in2, LOW);
digitalWrite(in4, LOW);
digitalWrite(in3, HIGH);
delay(2000); //Delaying it for 2 seconds

  digitalWrite(in1,LOW); //Stopping the car
  digitalWrite(in2,LOW);
  digitalWrite(in3,LOW);
  digitalWrite(in4,LOW);
  delay(2000); //Stopping the car


digitalWrite(in1, HIGH); //Making the car go left
digitalWrite(in2, LOW);
delay(2000);

  digitalWrite(in1,LOW); //Making the car stop
  digitalWrite(in2,LOW);
  digitalWrite(in3,LOW);
  digitalWrite(in4,LOW);
  delay(2000); //Stopping the car

digitalWrite(in1, LOW); //Making the car go backwards
digitalWrite(in2, HIGH);
digitalWrite(in4, HIGH);
digitalWrite(in3, LOW);
delay(2000); //Stopping the car

  digitalWrite(in1,LOW); //Stopping the car
  digitalWrite(in2,LOW);
  digitalWrite(in3,LOW);
  digitalWrite(in4,LOW);

}

void loop() {
                  
 
}

Credits

justsid28
0 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.