HI:
I just build my zumo robot with arduino shield. It work great on maze solver and line follow arduino code. But the sumo Collision detection seems not working. The robot only constantly move forward and backward, and random turn left and right. It won’t move straight to the border line like the one I saw on the video.
Do I missing something ? or the I need to adjust the arduino code ?
I use arduino uno. I did not soldering any jumper on the zumo shield since they are connected by default Do I need to solder any of this jumper on scl and sda ?
After reading the user guide… still can not find anything wrong on my setup. currently I did not have any jumper on the SDA and SCI which is base on the user manu. They are connect by default.
Can you post pictures here that show your robot and any soldered connections you have made? Also, do any of the other IMU examples (like the Compass) example work? The BorderDetect sketch is a more basic sumo code. Does that one work?
After hours of debugging, I found a solution. I made a few modifications to the border detection code, and it worked. There is no issue with the hardware.
I modified the sample border detection code from the Pololu download link . Line 72," if (sensor_values[0] < QTR_THRESHOLD)", Ichange to " if (sensor_values[0] > QTR_THRESHOLD)". I should be greater the QTR_threshold.
Line 81,“else if (sensor_values[5] < QTR_THRESHOLD)” I changed to “else if (sensor_values[5] > QTR_THRESHOLD)”. It works perfectly now.
It should be greater than the QTR_threshold on both if statements.
Not sure the code is wrong or my IR sensor reading is reversed.
I am glad you were able to get it working. The demo code is written for black colored sumo rings with a white border like the video below. When you placed it on the white surface, the robot thought it was seeing the edge of the ring and kept backing away each time it looked at those sensors. Inverting the logic statement should cause it to stay in a white area and reverse when it encounters any black lines.