Introduction: Setting Up Fixed Distance by Board L293D for Arduino
Setting up fixed distance between Smart car and things by Motor Drive Shield Expansion Board L293D For Arduino
This tutorial will give code to show how to set up a fixed distance between a smart robot car and subjects by L293D board from www.ICStation.com. We have that Motor drive shield and Many people think that COM port of Board L293D has been taken, actually not. You can find there is no wire connected with those pins, and we can use them a lot. PWM port(pin 10 and pin 9) can be connected with steering engine and else. Pin0,1,2 and pin 13 need to be soldered by electric iron.Pin0 is PX, pin1 is TX, and when connected with bluetooth or port WIFI module, L293D can be wireless control.
As port 2 and 13 is available, we can connect them with Ultrasonic Module for distance.
AF_DCMotor motor1(1, MOTOR12_64KHZ);
AF_DCMotor motor2(2, MOTOR12_64KHZ);
int distance = pulseIn(inputPin, HIGH);
if (distance = 50)
if (distance < 120 )
if (distance > 50)
We have a be nice policy.
Please be positive and constructive.