I have a question related to NXT hardware and Bricx software.. With a line following robot there is a problem with changing ambient light which shifts the required setpoint. An obvious choice how to get rid of this is to blink with the LED in the light sensor and subtract the two readings (LED on and off) which should cancel out the ambient... Of course one can use some shield around the sensor, but it is not so nice...
I can blink with the LED at frequency of 500 Hz (measured by oscilloscope and probe with photodiode..) using following code:
With a different function the blinking is very slow:
But the problem appears when one needs to read the values from the sensor:
A = SensorRaw(IN_1);
B = SensorRaw(IN_1);
C = B-A;
}; //23.8Hz it can blink faster, but I get readings only for Wait >21ms, otherwise I get probably zeros (writing to LCD, or using motor functions as indicator)
This gives some meaningful results only for long Waits, which than vastly degrades the control loop speed...
Please is there another way how to use "modulated" light sensor at higher speed - like 100-200Hz?
I have not found anything on this topic "using google" for some reasonable time... which seems quite strange concerning the usefulness of the principle..
Thank you for any suggestion
Users browsing this forum: No registered users and 11 guests