Skip to content

mrzaizai2k/Wall-following-car-with-Arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Wall-following-car-with-Arduino

Check out my 2 YOUTUBE channels for more:

  1. Mrzaizai2k - AI (NEW)
  2. Mrzaizai2k (old)

Maze solving with wall follower algorithm

The video pretty much explains it all:

YOUTUBE LINK: Wall following car with Arduino_Mrzaizai2k

My Arduino Code: https://drive.google.com/open?id=1q8XpYHIeALv2iSNh2W_P4Ljrv5eGn_sh

Reference:

  1. Sử dụng cảm biến khoảng cách HC-SR04: http://arduino.vn/bai-viet/233-su-dung-cam-bien-khoang-cach-hc-sr04
  2. Sử dụng LCD 16x2 với giao tiếp I2C: https://arduinokit.vn/giao-tiep-i2c-lcd-arduino
  3. Sử dụng motor driver shield L293D: http://arduino.vn/bai-viet/429-lam-du-xe-voi-module-dieu-khien-dong-co-l293d
  4. Clip full tutorial: https://www.youtube.com/watch?v=zLAac7GA5HE

Table of Contents

  1. Overview
  2. Functions 2.1 Stop (dung()) 2.2 Move Forward (tien()) 2.3 Move Backward (lui()) 2.4 Turn Left (retrai()) 2.5 Turn Right (rephai())
  3. Distance Measurement

Overview

This Arduino code controls a robot equipped with an Arduino Uno, an ultrasonic sensor (HC-SR04), and four DC motors (AFMotor library). The robot's movements are determined based on measured distances in the front and on the sides. The main functionalities include stopping the robot, moving it forward and backward, and turning it left or right.

Functions

2.1 Stop (dung())

Stops all motors, displaying "DUNG" on an LCD.

2.2 Move Forward (tien())

Moves the robot forward with adjustable speed.

2.3 Move Backward (lui())

Moves the robot backward with adjustable speed.

2.4 Turn Left (retrai())

Turns the robot to the left.

2.5 Turn Right (rephai())

Turns the robot to the right.

Distance Measurement

  1. Front Distance (distancefront()): Measures the distance in front using the HC-SR04 sensor.

  2. Side Distance (distanceside()): Measures the distance on the side using the HC-SR04 sensor.

The main loop continuously measures distances, displays the status on an LCD, and controls the robot's movements based on button input. The code provides flexibility for customizing motor speeds and distance thresholds to suit specific project requirements.

Releases

No releases published

Packages

No packages published

Languages