Mini Robot Car in the size of Arduino Uno | ATtiny85 | L293D


In this video we will build a mini robot car in the size of Arduino UNO. We will control this car with an ATtiny85 mini board. We will also use one L293D IC to drive the motors. In the coming days we will add additional features of this car. Like HC-SR04 and IR Remote Control. Required Hardware: ATtiny85 Mini Board - https://goo.gl/JYMLQZ L293D IC - https://goo.gl/9j84ft DC Gear Motor - https://goo.gl/sWegWC Rubber Wheels -https://goo.gl/v9Dk6K Ball Wheel - https://goo.gl/A3bGWV Mini Breadboard - https://goo.gl/uvEhR1 3 in 1 Jumper Wires - https://goo.gl/EGTafY 9V Battery - https://goo.gl/xaD6Tf Other Tools (Optional): Realacc Four Arms Holder - https://goo.gl/BCehBi DANIU Soldering Tool Kit - https://goo.gl/2oZhtu 20W Hot Melt Glue Gun - https://goo.gl/tVwhE5 For using the ATtiny85 with the Arduino IDE, you can watch the following tutorial: https://youtu.be/vPRpT_7rQNo

Source Code:
//Motor 1 (Right) Backward Pin
const byte MOTOR1_BWD = 0;
//Motor 1 (Right) Forward Pin
const byte MOTOR1_FWD = 1;

//Motor 2 (Left) Forward Pin
const byte MOTOR2_FWD = 3;
//Motor 2 (Left) Backward Pin
const byte MOTOR2_BWD = 2;

void stopMert(){
  digitalWrite(MOTOR1_BWD, LOW);
  digitalWrite(MOTOR1_FWD, LOW);
  digitalWrite(MOTOR2_FWD, LOW);
  digitalWrite(MOTOR2_BWD, LOW);
}

void forwardMert(){
  digitalWrite(MOTOR1_BWD, LOW);
  digitalWrite(MOTOR1_FWD, HIGH);
  digitalWrite(MOTOR2_FWD, HIGH);
  digitalWrite(MOTOR2_BWD, LOW);
}

void backwardMert(){
  digitalWrite(MOTOR1_BWD, HIGH);
  digitalWrite(MOTOR1_FWD, LOW);
  digitalWrite(MOTOR2_FWD, LOW);
  digitalWrite(MOTOR2_BWD, HIGH);
}

void leftMert(){
  digitalWrite(MOTOR1_BWD, LOW);
  digitalWrite(MOTOR1_FWD, HIGH);
  digitalWrite(MOTOR2_FWD, LOW);
  digitalWrite(MOTOR2_BWD, HIGH);
}

void rightMert(){
  digitalWrite(MOTOR1_BWD, HIGH);
  digitalWrite(MOTOR1_FWD, LOW);
  digitalWrite(MOTOR2_FWD, HIGH);
  digitalWrite(MOTOR2_BWD, LOW);
}

void setup(){
  pinMode(MOTOR1_BWD, OUTPUT);
  pinMode(MOTOR1_FWD, OUTPUT);
  pinMode(MOTOR2_FWD, OUTPUT);
  pinMode(MOTOR2_BWD, OUTPUT);
  
  digitalWrite(MOTOR1_BWD, LOW);
  digitalWrite(MOTOR1_FWD, LOW);
  digitalWrite(MOTOR2_FWD, LOW);
  digitalWrite(MOTOR2_BWD, LOW);
}

void loop(){
  stopMert();
  delay(1000);
  forwardMert();
  delay(1000);
  stopMert();
  delay(1000);
  backwardMert();
  delay(1000);
  stopMert();
  delay(1000);
  leftMert();
  delay(1000);
  stopMert();
  delay(1000);
  rightMert();
  delay(1000);
  stopMert();
  delay(1000);
}