How do I combine a line follower and obstacle avoidance code?


#1

I have this line follower code (I haven’t tested it so if you see an issue with it, please let me know), and another code to stop the bot when it senses something in front of it to stop (that code has been tested by itself, in the crudely taken photo).

What is the best way to combine both of these codes to work at the same time? I’ve tried out a couple things before and they weren’t very successful, our bot was having a seizure or something lmao. A visual representation would be great if possible.

Also, side question, is there a way to code the robot to pick an option when it comes to an intersection? Like how might the bot sense it? Not important but if there is actually a way to do it and combine it, that would be awesome.

Sort of a beginner to this thing, so any help is highly appreciated. Thank you!


image


#2

I believe I have a code for this on my device. Can you wait about a week so I can get it for you when I return from my trip?

Thanks! @fuzzy


#3

Do you know roughly the concept of how you did it, so maybe I could try something else?


#4

I’m a bit short on time right now, sorry :pensive:.
Mention me in three days as @Best_codes and I might be available.