We´re a 16 years old students group. We want to resolve a LEGO trail with Arduino. We have a simply line follower with a tb6612fng, arduino uno and a qtra sensors array.
The trail is to follow the line until to find a object. If the object is black , the robot must catch it and return by the black line to the start, leave the line , turn left or right, release the object, and go for follow the line again....
If the object is white, the robot must catch the object, turn left or right, leave the line, release the object out of the line, return to the line, and follow the line again, until a new object.....
We need help, lol!
We are thinking about put a cny70 who read the object colour. We haven´t a better idea. Connect it to an analogic pin and distinguish between ambiental light, black object and white object.
For the sketch...we are thinking about to work with the sensors values from the qtra. Something like this:
if (sensorValues[1] < 750 && sensorValues[2] < 750 && sensorValues[3] > 750 && sensorValues[4] > 750 && sensorValues[5] < 750 && sensorValues[6] < 750 && cnsensor < 200)
{
Serial.print ("we are over the line and there is not any object ");
delay (2000);
goahead()
}
else if (sensorValues[1] < 750 && sensorValues[2] < 750 && sensorValues[3] > 750 && sensorValues[4] > 750 && sensorValues[5] < 750 && sensorValues[6] < 750 && 200 > cnsensor > 200)
{
Serial.print ("we are over the line and there is a black object ");
delay (2000);
catchit()
gobackward()
}
but I can get good results...
Can anyone help me please?
Thanks a lot!!
You can also (and better) answer me in Spanish