<< return to Pixycam.com

Line following + object avoiding

Hi guys, I am a beginner in Arduino and Pixy, can you guys help me with the code on how to make Pixy avoid objects while following lines?

Hello,
What kind of objects do you want to avoid? Perhaps a sonar sensor would help with detecting objects to avoid?

Edward

like small cars, i want her to avoid that object and then follow again the line.

Hello,
Sonar is good for detecting obstacles or anything in the way of your robot.

Hope this helps :slight_smile:

Edward

Hiii,
there’s no other way? without using sonar sensor. we only have pixy2, arduino and L293D Board. We really appreciate your help. Thank you :slight_smile:

can you help us with combining the line tracking and color connected codes?

Hello,
Pixy2 runs 1 program at a time, so it cannot track lines while also detecting objects using the color connected components program. You can call changeProg() though, and essentially switch between the two programs rapidly. This can be tricky though and slows things down quite a bit. And I’m assuming that the obstacles you want your robot to avoid would be detectable by Pixy’s color connected components algorithm.

https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:general_api

That’s why I was suggesting the sonar. It is a good at detecting obstacles and it won’t interfere with Pixy.

Edward

can u give us sample code in line following with barcodes?

Hi, this should be helpful: https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:line_quickstart

Cheers,
Jesse