Programming Code BS2 to get Motor Running Through L293D HELP!!!!
chale01
Posts: 1
Hi Everyone,
I'm doing a project, using a BS2 Microcontroller, an ultrasonic radar, and two dc motors connected to a car and an L293D chip all on a breadboard. I want the motors to run when the radar detects a distance greater than 6 inches.
I have got the Ultrasonic radar working and displaying the distances.
I'm getting stuck when trying to program the motors to run once the distance is greater than 6 inches from the radar.
Any program codes that you think might help me out would be much appreciated.
Happy to answer any questions you have as well.
Thanks!
I'm doing a project, using a BS2 Microcontroller, an ultrasonic radar, and two dc motors connected to a car and an L293D chip all on a breadboard. I want the motors to run when the radar detects a distance greater than 6 inches.
I have got the Ultrasonic radar working and displaying the distances.
I'm getting stuck when trying to program the motors to run once the distance is greater than 6 inches from the radar.
Any program codes that you think might help me out would be much appreciated.
Happy to answer any questions you have as well.
Thanks!
Comments
If you have the distance from the ultrasonic sensor, you can use that to control the motors. If the distance is greater than 6" (converted to whatever units the distance sensor uses), you'll want to turn the motors on, one forward and one reverse (since it's on the other side of the robot). If the distance is less than 6", you'll want to turn both motors off. If you want some kind of more complicated behavior, you'll have to describe what you want in detail.