Pololu Robotics & Electronics
My account Comments or questions? About Pololu Contact Ordering information Distributors

Doubts in programming


EN - Hello everyone
I am programming my 3PI / atmega328p with atmel studio 7 and I had two doubts.
I would like to know which command I can use so that after the robot leaves the black line, it continues straight, because the track that I’m going to compete has “failures” during the way.
The second question is about the choice he makes when he finds an entry. I realized that his preferred option is to go left, but I do not want it, I would like him to ignore left / right entries because in the league this would lead to an endless track.

PT - Olá a todos Estou programando meu 3PI/atmega328p com o atmel studio 7 e me surgiram duas dúvidas. Eu gostaria de saber qual comando posso usar para que, após o robô sair da linha preta, ele continue em linha reta, pois a pista que eu vou competir tem “falhas” durante o caminho. A segunda dúvida é em questão da escolha que ele faz quando econtra uma entrada. Eu percebi que a opção preferencial dele é ir pela esquerda, mas eu não quero isso, eu gostaria que ele ignorasse entradas esquerda/direita pois no campeonato isso levaria para uma trilha sem fim.

Black and white line following
Erasing device failed - Windows 8

What code is required to program 3pi so that it continues at full speed even after the end of the black line?



I moved your thread to our “Robots” subforum, which seemed more appropriate, and merged your other post into this thread since it is about the same issue.

The 3pi does not have a singular command that automatically directs the robot to continue straight and ignore right and left turns. You would need to write your own code to implement that logic. One way to create that behavior is to first detect an intersection, consisting of one or more turns, and maintain your 3pi’s current speed for each motor so that the robot continues forward instead of turning right or left. You might find it helpful to look at (and modify) our 3pi-mazesolver code, particularly the maze_solve function in maze-solve.c, to get an idea of how it handles intersections.

- Amanda


I can make do this using PID?


Probably not. You would need to pause PID control when handling the intersections in your course.

- Amanda