Concept Explanation: View Sensor Values on NXT

Printer-friendly version

It's important to note that the value for the "threshold" variable was not picked at random. That number was picked because we tested the different regions on the field for what value the sensor will output. The NXT provides menu options that allow you to see the current sensor value. Use the arrow buttons to change your selection and the orange button to pick the selected menu option.

ViewSensor

The above example shows how to view a light sensor connected on port 3. Let's see what our sensor readings are.

ViewSensorValues

When the NXT is on Black, SensorValue(S3) will return an integer of 29 and when the NXT is on white, it will return an integer of 65. We can now evaluate the current sensor reading of the light sensor to determine if the NXT is on a black region or white region.