# Line follower avoid obstacles with servo motor

**URL:** <https://forum.arduino.cc/t/line-follower-avoid-obstacles-with-servo-motor/985931>\
**Category:** Programming\
**Created:** [April 27, 2022, 11:03pm UTC](https://forum.arduino.cc/t/line-follower-avoid-obstacles-with-servo-motor/985931 "2022-04-27T23:03:06Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![Johan\_Ha](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johan_ha/32/263751_2.png) [@Johan\_Ha](https://forum.arduino.cc/u/Johan_Ha)\
**Post date:** [May 1, 2022, 8:12pm UTC](https://forum.arduino.cc/t/line-follower-avoid-obstacles-with-servo-motor/985931/23 "2022-05-01T20:12:29Z")

</div>

When the car in the video sees something straight ahead, it turns the sonar 90 degrees to left, then it turns itself 90 degrees to right. Then it tries to drive having the obstacle at a constant distance at the left. When the obstacle disappears, the car turns to the left until the obstacle reappear to the car's left. This goes on until there's a line to follow again. At that point the car obviously has to turn to the right to follow the line again.

---

<div class="post-metadata">

**Author:** ![Johan\_Ha](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johan_ha/32/263751_2.png) [@Johan\_Ha](https://forum.arduino.cc/u/Johan_Ha)\
**Post date:** [May 2, 2022, 5:01am UTC](https://forum.arduino.cc/t/line-follower-avoid-obstacles-with-servo-motor/985931/24 "2022-05-02T05:01:33Z")

</div>

> [@milan123c](#):
>
> I have until tuesday for this to be ready

If this is a school assignment, I bet you have got it months ago. Surely your teacher can't expect you to just google and find suitable code from somewhere. You can rebuild a well documented project without understanding the code, but you can't adapt code to your own project without understanding the code.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [October 29, 2022, 5:01am UTC](https://forum.arduino.cc/t/line-follower-avoid-obstacles-with-servo-motor/985931/25 "2022-10-29T05:01:38Z")

</div>

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

[Previous page](https://forum.arduino.cc/t/line-follower-avoid-obstacles-with-servo-motor/985931.md?page=1)
