Welcome to Open Discussion
What is the algorithm to calculate value for the light sensor? Does it just mesure some particular point under sensor or it operates with several ones?
Hi alex-kolotov ,
the light value is calculated as the mean value of neighboring points.
How many of such points are used? 5 (cross) or 9 (3x3 points)?
The reason I am asking is that I tried to implement P regulator to be run on nxcSimulator. But it does not behave as I desire. Someting closely similar to P-regulator-behavior I achieved when added my own background - gradient from black to white.
I have just looked at the source code. I wonder about myself, it should actually be calculated 3x3 points, but I have removed this feature. The calculation is performed at the time only by one point. Here all three RGB values are added and then an average value is calculated. The maximum possible mean value 255 corresponds to 100 percent of the light sensor.
I've just implemented a menu for the next version that lets you choose between 1, 3x3, 5x5, 7x7 and 9x9 pixels for the resolution of the light sensor.
Thanks Frank! It should be very useful!
How worth it would be to add any debug ability, at least simulator of NXT screen? It will be great to see information that see sensors in run time.
A very simple "NXT screen" is on the left side of the simulator (look at the nxcSimulator menu -> Help). Try for example: NumOut (0, LCD_LINE1, SENSOR_1); … it will only work with "LCD_LINE…" not with numbers!
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.