Controlling DC motor with ultrasonic sensor in arduino uno

Please help me, I've been using multiple codes on google but none are working. I'm just a student and a beginner. Thanks!

Please read and follow the topic "How to get the best out of this forum".
Forum is not a free code hive away shop.
Show Your best attempt following the topic above.

have you tested the ultrasonic sensor and DC motor control in separate programs?
did they work OK?
how are you powering the system? the DC motor will probably require an external power supply

If you want anything more than sympathy, please read and follow the suggestions in the how to use the forum posts.

Format your code using the IDE autoformat tool.

Post your code in a code block.

Tell us what the code is suppsed to do. Tell us what the code really does.

Post clear schematics or wiring diagrams.

Post photos showing to components and wiring.

@elijah2008

Verify your controller. One DC motor controller might use two pins for direction (DIO) and one pin for speed (PWM). Another DC motor controller might use two pins for direction and one pin for speed. When you post your sketch, also include the type of motor controller.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.