lejos.robotics
Interface LampLightDetector

All Superinterfaces:
LightDetector
All Known Implementing Classes:
ColorLightSensor, LightSensor, RCXLightSensor

public interface LampLightDetector
extends LightDetector

Interface for a light sensor that also includes a lamp (usually LED) to provide illumination.

Author:
BB

Method Summary
 Colors.Color getFloodlight()
          Returns the color of the floodlight, including Color.NONE.
 boolean isFloodlightOn()
          Checks if the floodlight is currently on.
 void setFloodlight(boolean floodlight)
          Turns the default LED light on or off.
 boolean setFloodlight(Colors.Color color)
          Used to turn on or off the floodlight by color.
 
Methods inherited from interface lejos.robotics.LightDetector
getHigh, getLightValue, getLow, getNormalizedLightValue
 

Method Detail

setFloodlight

void setFloodlight(boolean floodlight)
Turns the default LED light on or off. If the sensor has more than one lamp color, this will control the red LED.

Parameters:
floodlight - true to turn on lamp, false for off (ambient light only).

isFloodlightOn

boolean isFloodlightOn()
Checks if the floodlight is currently on.

Returns:
true if on, false if off.

getFloodlight

Colors.Color getFloodlight()
Returns the color of the floodlight, including Color.NONE.

Returns:
An enumeration of the current color.

setFloodlight

boolean setFloodlight(Colors.Color color)
Used to turn on or off the floodlight by color. If the sensor has multiple light colors, you can control which color is turned on or off. If the color does not exist, it does nothing and returns false.

Parameters:
color - Use lejos.robotics.Color enumeration constant to control lamp colors.
Returns:
True if lamp changed, false if lamp color doesn't exist for this sensor.