Package lejos.robotics
Interface LampController
-
- All Known Implementing Classes:
EV3ColorSensor,NXTColorSensor,NXTLightSensor,RCXLightSensor
public interface LampControllerInterface for a light sensor that also includes a lamp (usually LED) to provide illumination.- Author:
- BB
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetFloodlight()Returns the color of the floodlight, including Color.NONE.booleanisFloodlightOn()Checks if the floodlight is currently on.voidsetFloodlight(boolean floodlight)Turns the default LED light on or off.booleansetFloodlight(int color)Used to turn on or off the floodlight by color.
-
-
-
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
int getFloodlight()
Returns the color of the floodlight, including Color.NONE.- Returns:
- An enumeration of the current color.
-
setFloodlight
boolean setFloodlight(int 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. You can turn the floodlight off by using Color.NONE.- Parameters:
color- UseColorenumeration constant to control lamp colors.- Returns:
- True if lamp changed, false if lamp color doesn't exist for this sensor.
-
-