Laura,
Stuart has it right. You need to change paradigms here. You have been "calibrating" by changing your code to select a new threshold level.
Calibration as normally handled by NXT-G is a process where you in effect provide a sample dark color to the brick and tell the brick to consider that color, and anything darker to be 0. i.e. the light sensor functions on that brick will now return 0 anytime this or a darker color is encountered. Likewise you provide a sample light color and tell the brick to consider that color and anything lighter or brighter to be 100. i.e. use of the light sensor functions will now return 100 anytime this or lighter is encountered.
So now you've really accomplished 2 things. You have set low and high levels for the present conditions and you have probably increased the resolution slightly. (uncalibrated values of, for example only, maybe 23 to 84 gives you a range of about 51, where a calibrated 0 to 100 gives you a range of 100). The thing you are counting on as part of this overall calibration process is you will probably be able to use 50, at least as your threshold level between black lines and white background, regardless of field and lighting conditions.
Execution the calibrate functions will create a persistent file on your brick. You can turn the brick on and off, and so long as you don't run the calibrate functions again or erase the little calibrate file, your brick will stay calibrated to the conditions that were there when you executed the calibrate functions.
There still may be times when you use a threshold level other than 50, but that will likely be when you are try to find a boundary of some middle (not black or white) color. And again it will probably be able to be kept constant so long as you keep re-calibrating each time you go to a field.
Calibrate can run entirely on the brick so you don't need to take any computer to the field. My kids have calibrate on the brick when they go to the field for their competition run. About the first 10 seconds of their setup time at the field is running their calibrate program.
I hope this helps,
Best Regards,
Jamie Diamond
On Thu, Nov 4, 2010 at 10:03 AM, Stuart & Lori Roll
<[log in to unmask]> wrote:
The calibration issue is this... you want your
light sensor to give you a reading of 0 for black and 100 for white but under
varying conditions, you might get some other range - say 23 to 84. By
calibrating the sensor you can get it back to 0-100 under your current
conditions. Remember of course that these are inexact measurements
which is why the sensor blocks have you look for "greater than" or "less than"
values.
Using sensor calibration you can adjust your robot
to handle different environmental conditions without changing your programs at
all.
For more info, instructions on how to use the
standard calibration program and other optional programs, try this
page.
Stuart
Sent: Thursday, November 04, 2010 9:24 AM
Subject: Re: [VADCFLL-L] calibration
My team is using light sensor- they have been taking the average of white
and black readings and imputing that theshold into their program. How can they
callibrate at the tournament when they can't have a computer at the table to
adjust the threshold if necessary?
To UNSUBSCRIBE or CHANGE your settings, please visit
https://listserv.jmu.edu/archives/vadcfll-l.html
and select "Join or leave the list".
VADCFLL administrative announcements
are sent via VADCFLL-ADMIN-L. Visit
https://listserv.jmu.edu/archives/vadcfll-admin-l.html
to subscribe.
To UNSUBSCRIBE or CHANGE your settings, please visit
https://listserv.jmu.edu/archives/vadcfll-l.html and select "Join or leave the list".
VADCFLL administrative announcements are sent via VADCFLL-ADMIN-L. Visit https://listserv.jmu.edu/archives/vadcfll-admin-l.html to subscribe.