Hello,
I'm building a line-following robot controlled by a myDAQ. To line follow, I'm using two 20K Ohm resistors and two photoresistors to build the diagram described here:http://www.acroname.com/howto/photoresistor/photoresistor.html I've built both circuits and connected the wires labeled "V" together. The circuit has the characteristic of a negative voltage when the light going to the left photoresistor is blocked, and a larger, positive voltage when the right photorestor is blocked.
However, the measured voltage continuously drops after the circuit is plugged into a 7.2V nimh battery. Therefore, I was thinking of storing the previous reading of voltage, then comparing it to the current voltage to see if the robot was going off the black line. The code below uses a for loop with a shift register, however it does not store the previous value.
Any help would be greatly appreciated.