Quote:
|
Originally Posted by KenWittlief
because there is only one light sensor, not two
|
Ah yes, I should have read the code more closely. For some reason I thought you were using 2 sensors (although, thinking more about it, I guess it wouldn't have worked in that case either).
Have you tried a bunch of printfs all over the place to try to pinpoint the time at which it changes? If so, is the teleDirection variable wrong immediately, on the first loop? It would also help to print out the raw p4_sw_auxX and rc_dig_inXX variables if you haven't tried that yet. That should tell you if you're simply reacting to invalid data or if there's some other kind of bug. Are you certain that this is the only code that can modify the teleDirection variable?