I was wondering how I actually calibrate the sensor. I’ve read the libraries and I’ve come up with the following code:
void calibration()
{
for (int i = 0; i < 250; i++)
{
qtrrc.calibrate(QTR_EMITTERS_ON); // (i.e. ~25 ms per call)
delay(20);
}
if (DEBUG)
{
Serial.begin(9600);
for (int i = 0; i < NUM_SENSORS; i++)
{
Serial.print(qtrrc.calibratedMinimumOn[i]);
Serial.print(’ ');
}
Serial.println();
for (int i = 0; i < NUM_SENSORS; i++)
{
Serial.print(qtrrc.calibratedMaximumOn[i]);
Serial.print(’ ');
}
Serial.println();
Serial.println();
}
}
My question is, what do I actually do physically to the sensors?
Do I put them on black, and then on white?
Do I do this once? Twice? Many?
Should I rotate the sensors above a line?
How do I actually use the DEBUG part of the code?
I’ve run it some times, and it returns some values that are somewhat coherent.
It always takes several seconds, and I just swipe the sensors multiple times over a white line with black background.
I would really like the calibration phase to be as quick as possible.
5 seconds would be nice. How do I achieve this?