NXT Light Sensor

../_images/nxtdevice-light.png
class LightSensor(port)

LEGO® MINDSTORMS® NXT Color Sensor.

Parameters:

port (Port) – Port to which the sensor is connected.

ambient() int: %

Measures the ambient light intensity.

Returns:

Ambient light intensity, ranging from 0% (dark) to 100% (bright).

reflection() int: %

Measures the reflection of a surface using a red light.

Returns:

Reflection, ranging from 0% (no reflection) to 100% (high reflection).