Will readLine() work with with just 2 QTR sensors?

Hi Everyone,

I’m writing a bunch of code for a friend’s robot, and though I have considerable experience with AVRs, this is my first stab at Arduino.

My friend’s robot has two line following sensors mounted on the front of the bot. If I use the PololuQTRSensors Arduino library, and set it up using just two sensors, am I correct in my understanding that readLine() will return a value from 0 to 1000? The reason I ask is that I only see examples for 3 or more sensors, and I don’t have the hardware to actually test it on.

Thanks in advance!

Brad

Hello,

Sure, that function should work with just two sensors. But if it doesn’t, you can implement it yourself pretty easily. The formula is just 1000*B/(A+B), where A and B are the calibrated readings of the two sensors.

-Paul