Front sensor array Zumo 32u4


I have to follow a line with this robot, but the problem is that sometimes the line is discontinuously.

I tried the example LineFollower and works well with no discontinuously.

The problem that I had is that I couldn’t read the value of the sensor array, to detect the color white with the five sensors.

I tried to read analog.Read(0 to 5) but doesn’t works.



As you mentioned, the example line following code does not support discontinuities in the line by default. You might be able to modify it to handle that kind of course, but we do not have any examples available for doing that. It sounds like you are on the right track by trying to detect when all of the sensors detect white, but I think you are a little confused on how the sensors work. The Zumo 32U4’s sensor board does not use analog sensors, so you should not be using analogRead() to read them.

In the LineFollower example code, the five sensors are being read with int16_t position = lineSensors.readLine(lineSensorValues);, and the calibrated readings are being stored in the lineSensorValues[] array. You might consider using the values in that array to determine when all the sensors are seeing white. You should be able to do this by checking each index of the array and comparing it to a threshold value. The readings should vary between 0 (when a sensor is over full white) and 2000 (when a sensor is over full black).