Instructions
Turn on the NXT brain. Plug the USB cord into your computer and into the brain. Connect the light sensor to one of the four numbered ports.
Open the Mindstorms application on your computer. Start a new program. Click "Tools" on the menu and select "Calibrate Sensors" from the list. Click on "Light Sensor" in the list of sensors and then click the "Calibrate" button beneath it.
Point the light sensor at a dark area, holding the sensor about an inch away from it to get an accurate reading. Press the orange button on the NXT brain to take the "dark" reading.
Point the sensor at a light area, holding it about an inch away from the surface. Press the orange button on the NXT brain to take the "light" reading. The calibration program will finish and the program will use these two readings as the minimum and maximum light values.